AtCoder Regular Contest 198 (Div. 2)
翻译中…
Problem Statement
翻译中…
Determine whether there exists a sequence $A=(A_1,A_2,\dots,A_{X+Y+Z})$ of length $X+Y+Z$ that contains exactly $X$ zeros, $Y$ ones, and $Z$ twos, and satisfies the following condition:
翻译中…
- For every
$i(1 \le i \le X+Y+Z)$, exactly$A_i$numbers among$A_{i-1}$and$A_{i+1}$are less than$A_i$.
翻译中…
Here, assume $A_0 = A_{X+Y+Z}$ and $A_{X+Y+Z+1} = A_1$.
翻译中…
You are given $T$ test cases. Solve each of them.
翻译中…
Constraints
翻译中…
$1 \le T \le 2 \times 10^{5}$$0 \le X,Y,Z \le 10^{9}$$3 \le X + Y + Z$
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
T
\mathrm{case}_1
\mathrm{case}_2
\vdots
\mathrm{case}_T
翻译中…
Each test case is given in the following format:
翻译中…
X\ Y\ Z
翻译中…
Output
翻译中…
Output $T$ lines. The $i$-th $(1 \le i \le T)$ line should contain Yes if such a sequence exists, and No otherwise.
翻译中…
样例
Input #1
4
2 1 1
3 4 5
1359 1998 1022
392848293 683919483 822948689
Output #1
Yes
No
Yes
No
For the first test case, the sequence $A = (2,0,0,1)$ satisfies the condition.
For the second test case, no sequence satisfies the condition.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。