CF2112A.Race

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

Race

Alice and Bob participate in a game TV show. When the game starts, the prize will be dropped to a certain point, and whoever gets to it first will get the prize.

Alice decided that she would start running from point aa. Bob, however, has not yet chosen his starting position.

Bob knows that the prize could drop either at point xx or at point yy. He also knows that he can reach the prize faster than Alice if the distance from his starting position to the prize is strictly less than the distance from Alice's starting position to the prize. The distance between any two points cc and dd is calculated as cd|c-d|.

Your task is to determine whether Bob can choose an integer point that is guarantee to get to the prize faster, regardless of where it appears (at point xx or yy). Bob can choose any integer point, except for aa (in particular, he can choose to start in point xx, point yy, or any other point, but not aa).

Input

The first line contains a single integer tt (1t10001 \le t \le 1000) — the number of test cases.

The only line of each test case contains three integers aa, xx, yy (1a,x,y1001 \le a, x, y \le 100). Points aa, xx, and yy are pairwise distinct.

Output

For each test case, print "YES" (case insensitive) if Bob can choose an integer point that is guarantee to get to the prize faster, regardless of where it appears. Otherwise, print "NO" (case insensitive).

Note

In the first example, Bob can choose point 44. If the prize will be at point xx, then Bob's distance is 43=1|4-3|=1 and Alice's distance is 13=2|1-3|=2. If the prize will be at point yy, then Bob's distance is 44=0|4-4|=0 and Alice's distance is 14=3|1-4|=3.

In the second example, Bob can choose point 22. If the prize will be at point xx, then Bob's distance is 23=1|2-3|=1 and Alice's distance is 53=2|5-3|=2. If the prize will be at point yy, then Bob's distance is 21=1|2-1|=1 and Alice's distance is 51=4|5-1|=4.

In the third example, Bob cannot choose a point to guarantee his victory.

Samples

3
1 3 4
5 3 1
3 1 5
YES
YES
NO

在线编程 IDE

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