AtCoder Regular Contest 171
A
No Attacking
AtCoder
⌀ 614
原题
←B →
翻译中…

Problem Statement

翻译中…

There is a chessboard with $N$ rows and $N$ columns. Let $(i, j)$ denote the square at the $i$-th row from the top and the $j$-th column from the left. You will now place pieces on the board. There are two types of pieces, called rooks and pawns. A placement of pieces is called a good arrangement when it satisfies the following conditions:

翻译中…
  • Each square has zero or one piece placed on it.
  • If there is a rook at $(i, j)$, there is no piece at $(i, k)$ for all $k$ $(1 \leq k \leq N)$ where $k \neq j$.
  • If there is a rook at $(i, j)$, there is no piece at $(k, j)$ for all $k$ $(1 \leq k \leq N)$ where $k \neq i$.
  • If there is a pawn at $(i, j)$ and $i \geq 2$, there is no piece at $(i-1, j)$.
翻译中…

Is it possible to place all $A$ rooks and $B$ pawns on the board in a good arrangement?

翻译中…

You are given $T$ test cases; solve each of them.

翻译中…

Constraints

翻译中…
  • $1 \leq T \leq 10^5$
  • $1 \leq N \leq 10^4$
  • $0 \leq A, B$
  • $1 \leq A + B \leq N^2$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format. Here, $\mathrm{case}_i$ represents the $i$-th case.

翻译中…

T
\mathrm{case}_1
\mathrm{case}_2
\vdots
\mathrm{case}_T

翻译中…

Each test case is given in the following format.

翻译中…

N A B

翻译中…

Output

翻译中…

Print $T$ lines. The $i$-th line should contain the answer for the $i$-th test case. For each test case, print Yes if it is possible to place the pieces in a good arrangement and No otherwise.

翻译中…

样例

Input #1
8
5 2 3
6 5 8
3 2 2
11 67 40
26 22 16
95 91 31
80 46 56
998 2 44353
Output #1
Yes
No
No
No
Yes
No
Yes
Yes
In the first test case, for example, you can place rooks at $(1, 1)$ and $(2, 4)$, and pawns at $(3, 3)$, $(4, 2)$, and $(5, 3)$ to have all the pieces in a good arrangement. In the second test case, it is impossible to place all the pieces in a good arrangement.
题目信息
题号
arc171_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。