CF2134A.Painting With Two Colors

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

Painting With Two Colors

You are given three positive integers nn, aa, and bb (1a,bn1\leq a,b \leq n).

Consider a row of nn cells, initially all white and indexed from 11 to nn. You will perform the following two steps in order:

  1. Choose an integer xx such that 1xna+11 \le x \le n - a + 1, and paint the aa consecutive cells x,x+1,,x+a1x, x+1, \ldots, x+a-1 red.
  2. Choose an integer yy such that 1ynb+11 \le y \le n - b + 1, and paint the bb consecutive cells y,y+1,,y+b1y, y+1, \ldots, y+b-1 blue.

If a cell is painted both red and blue, its final color is blue.

A coloring of the grid is considered symmetric if, for every integer ii from 11 to nn (inclusive), the color of cell ii is the same as the color of cell (n+1i)(n+1-i). Your task is to determine whether there exist integers xx and yy such that the final coloring of the grid is symmetric.

Input

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

The first and the only line of each test case contains three integers nn, aa, and bb (1n1091 \le n \le 10^9, 1a,bn1 \le a,b \le n) — the number of cells of the grid and the number of cells to be painted in each step.

Output

For each testcase, output "YES" if it is possible that the final coloring of the grid is symmetric; otherwise, output "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

In the first test case, the grid becomes symmetric when choosing x=2x = 2 and y=3y = 3, so the answer is "YES". The following figure illustrates each step of the coloring process:

In the second test case, the grid becomes symmetric when choosing x=2x = 2 and y=2y = 2, so the answer is "YES". The following figure illustrates each step of the coloring process:

In the third and fourth test cases, it can be proved that no choice of xx and yy results in a symmetric grid, so the answer is "NO".

Samples

7
5 3 1
4 1 2
7 7 4
8 3 7
1 1 1
1000000000 1000000000 1000000000
3 2 1
YES
YES
NO
NO
YES
YES
NO

在线编程 IDE

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