CF2199A.Game

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

Game

Alice and Bob are playing a card game. The game consists of 33 rounds, in each round both players score some points (from 00 to kk), and for each round, Alice's score differs from Bob's score. The player who scores more points in a round is considered the winner of that round.

In the first round, Alice scored a1a_1 points, and Bob scored b1b_1. In the second round, Alice scored a2a_2 points, and Bob scored b2b_2.

The winner of the game is the one who has the higher total score. If Alice's total score equals Bob's total score, the player who won more rounds is declared the winner. Alice wants to understand if Bob has a chance to win, or if she will definitely win regardless of the results of the 33-rd round. Help her determine this!

Please note that in each round, a player can score at least 00 and at most kk points. Additionally, for each round, Alice's score differs from Bob's score.

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

Each test case consists of three lines:

  • the first line contains a single integer kk (1k501 \le k \le 50) — the maximum number of points that can be scored in a round;
  • the second line contains two integers a1a_1 and b1b_1 (0a1,b1k0 \le a_1, b_1 \le k; a1b1a_1 \ne b_1) — the points scored by Alice and Bob respectively in the first round;
  • the third line contains two integers a2a_2 and b2b_2 (0a2,b2k0 \le a_2, b_2 \le k; a2b2a_2 \ne b_2) — the points scored by Alice and Bob respectively in the second round.

Output

For each test case, output NO if Alice will win regardless of the results of the third round, or YES if Bob has a chance to win.

Note

In the first example, Bob will win if, for example, Alice scores 33 points in the last round, and Bob scores 22.

In the second example, Bob will win if Alice scores 00 points in the last round, and Bob scores 55.

Samples

5
6
2 3
1 4
5
3 1
3 1
3
3 1
3 1
10
0 1
10 0
4
3 1
3 1
YES
YES
NO
YES
NO

在线编程 IDE

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