CF2136A.In the Dream

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

In the Dream

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 00.

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:ba:b, where aa is the score of the RiOI team, and bb is the score of the KDOI team;
  • And, the score at the end of the second half was c:dc:d, where cc is the score of the RiOI team, and dd 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 tt (1t10001 \le t \le 1000). The description of the test cases follows.

The only line of each test case contains four integers aa, bb, cc, and dd (0ac1000 \le a \le c \le 100, 0bd1000\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 R to represent the RiOI team's goal, and K to represent the KDOI team's goal.

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

  • First half: KKRKK. At the end of the first half, the score is 1:41:4;
  • Second half: No goals. At the end of the second half, the score is still 1:41:4.

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

  • First half: RRKRR. At the end of the first half, the score is 4:14:1;
  • Second half: No goals. At the end of the second half, the score is still 4:14:1.

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

  • First half: KKRKK. At the end of the first half, the score is 1:41:4;
  • Second half: KR. At the end of the second half, the score is 2:52:5.

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

Samples

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
YES
YES
YES
NO
NO
YES
NO
NO
YES
YES
YES

在线编程 IDE

建议全屏模式获得最佳体验