{"problem":{"name":"Rivalry","description":{"content":"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","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc198_b"},"statements":[{"statement_type":"Markdown","content":"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:\n\n*   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$.\n\nHere, assume $A_0 = A_{X+Y+Z}$ and $A_{X+Y+Z+1} = A_1$.\nYou are given $T$ test cases. Solve each of them.\n\n## Constraints\n\n*   $1 \\le T \\le 2 \\times 10^{5}$\n*   $0 \\le X,Y,Z \\le 10^{9}$\n*   $3 \\le X + Y + Z$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\mathrm{case}_2$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach test case is given in the following format:\n\n$X\\ Y\\ Z$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc198_b","tags":[],"sample_group":[["4\n2 1 1\n3 4 5\n1359 1998 1022\n392848293 683919483 822948689","Yes\nNo\nYes\nNo\n\nFor the first test case, the sequence $A = (2,0,0,1)$ satisfies the condition.\nFor the second test case, no sequence satisfies the condition."]],"created_at":"2026-03-03 11:01:13"}}