Codeforces Round 1046 (Div. 2)
A
In the Dream
Codeforces
800
原题
←B →
翻译中…

Two football teams, the RiOI team and the KDOI team, are about to have a football match. A football match consists of two halves — the first half and the second half. At the beginning of the match, both teams have a score of $0$.

翻译中…

As a fan of both teams, Aquawave knows that the two teams have similar levels, so neither team will score three consecutive goals in the same half.

翻译中…

Aquawave had a dream the night before the match, in which:

翻译中…
  • The score at the end of the first half was $a:b$, where $a$ is the score of the RiOI team, and $b$ is the score of the KDOI team;
  • And, the score at the end of the second half was $c:d$, where $c$ is the score of the RiOI team, and $d$ is the score of the KDOI team.
翻译中…

You have to determine whether Aquawave's dream can come true according to the above information.

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 1000$). The description of the test cases follows.

翻译中…

The only line of each test case contains four integers $a$, $b$, $c$, and $d$ ($0 \le a \le c \le 100$, $0\le b \le d \le 100$) — the score at the end of the first half and the score at the end of the second half.

翻译中…

Output

翻译中…

For each test case, print "YES" if Aquawave's dream can come true. Otherwise, print "NO".

翻译中…

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

翻译中…

Note

翻译中…

We will use $\texttt{R}$ to represent the RiOI team's goal, and $\texttt{K}$ to represent the KDOI team's goal.

翻译中…

In the first test case, the only goal order is:

翻译中…
  • First half: $\texttt{KKRKK}$. At the end of the first half, the score is $1:4$;
  • Second half: No goals. At the end of the second half, the score is still $1:4$.
翻译中…

In the second test case, the only goal order is:

翻译中…
  • First half: $\texttt{RRKRR}$. At the end of the first half, the score is $4:1$;
  • Second half: No goals. At the end of the second half, the score is still $4:1$.
翻译中…

In the third test case, one possible goal order is:

翻译中…
  • First half: $\texttt{KKRKK}$. At the end of the first half, the score is $1:4$;
  • Second half: $\texttt{KR}$. At the end of the second half, the score is $2:5$.
翻译中…

In the fourth test case, at the end of the first half, the KDOI team has scored $100$ goals, while the RiOI team did not score any goals. Thus, in Aquawave's dream, the KDOI team scored $100$ consecutive goals in the first half, which is impossible.

翻译中…

样例

Input #1
11
1 4 1 4
4 1 4 1
1 4 2 5
0 100 0 100
1 4 2 9
3 1 13 5
8 11 17 36
19 41 30 50
20 38 30 60
0 0 0 0
100 100 100 100
Output #1
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
YES
InputCopy OutputCopy
题目信息
题号
2136A
时间限制
1 s
内存限制
256 MB
标签
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。