2.3 Ayaan and Hriday's Hall of Fame
Our College has a long hallway that has n spots arranged in a line, numbered 1 through n.
Now, Ayaan and Hriday, want to place some decorations in the hallway:
1. Ayaan picks a position x (1 ≤ x ≤ n−a+1) and places decorations in a row starting from that spot.
2. Hriday then picks a position y (1 ≤ y ≤ n−b+1) and places b decorations in a row starting from that spot.
If they both put decorations on the same spot, Hriday’s decorations remain visible.
Ma’am wants the hallway to look symmetric, i.e, for each spot i (1 ≤ i ≤ n), the decoration at position i must look the same as at position (n+1−i).
Your task is to decide if Ayaan and Hriday can choose their starting positions in such a way that the final decorated hallway is symmetric.
Constraints
(1 <= t <= 100).
(1 <= n <= 10^9, 1 <= a,b <= n).
Input Format
The first line contains t - the number of test cases (1 <= t <= 100).
Each test case has three integers n, a, b (1 <= n <= 10^9, 1 <= a,b <= n).
Output Format
For each test case, print "YES" if symmetry is possible, otherwise "NO".
Example 1
Input:
3
5 3 1
4 1 2
7 7 4
Output:
YES
YES
NO
Explanation:
First Test Case:
The grid becomes symmetric when choosing x = 2 and y = 3, so the answer is "YES".
Second Test Case:
The grid becomes symmetric when choosing x = 2 and y = 2, so the answer is "YES".
Third Test Case:
It can be proved that no choice of x and y results in a symmetric grid, so the answer is "NO".
Log In to solve the Question