{"problem":{"name":"Avoid Half Sum","description":{"content":"You are given a sequence of non-negative integers $A=(A_1,A_2,\\dots,A_N)$ of length $N$. Here, $S=\\sum_{i=1}^{N} A_i$ is even. Determine whether there is a pair of sequences of non-negative integers o","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc065_c"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of non-negative integers $A=(A_1,A_2,\\dots,A_N)$ of length $N$. Here, $S=\\sum_{i=1}^{N} A_i$ is even.\nDetermine whether there is a pair of sequences of non-negative integers of length $N$, $B=(B_1,B_2,\\dots,B_N)$ and $C=(C_1,C_2,\\dots,C_N)$, that satisfy the following conditions:\n\n*   $B_i+C_i=A_i$ for $i=1,2,\\dots,N$.\n*   $\\sum_{i=1}^{N} X_i \\neq \\frac{S}{2}$ for every sequence of integers $X=(X_1,X_2,\\dots,X_N)$ of length $N$ where $X_i=B_i$ or $X_i=C_i$ for $i=1,2,\\dots,N$.\n\nSolve $T$ test cases.\n\n## Constraints\n\n*   $1 \\leq T$\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i \\leq 10^9$\n*   $\\sum_{i=1}^{N} A_i$ is even.\n*   The sum of $N$ over all test cases in a single input is at most $2 \\times 10^5$.\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach case is given in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc065_c","tags":[],"sample_group":[["3\n3\n1 2 3\n6\n1 1 2 2 3 3\n4\n1 1 1000000000 1000000000","Yes\nNo\nYes\n\nFor the first test case, $B=(1,1,3)$ and $C=(0,1,0)$ satisfy the conditions.\nFor the second test case, no pair of $B$ and $C$ satisfies the conditions."]],"created_at":"2026-03-03 11:01:14"}}