{"problem":{"name":"+1 and -1","description":{"content":"You are given an integer sequence $A = (A_1, A_2, \\dots, A_N)$ of length $N$.   You can perform the following operation any number of times, possibly zero: *   Choose an integer pair $(i, j)$ satisfy","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc185_b"},"statements":[{"statement_type":"Markdown","content":"You are given an integer sequence $A = (A_1, A_2, \\dots, A_N)$ of length $N$.  \nYou can perform the following operation any number of times, possibly zero:\n\n*   Choose an integer pair $(i, j)$ satisfying $1 \\leq i \\lt j \\leq N$, and replace $A_i$ with $A_i + 1$ and $A_j$ with $A_j - 1$.\n\nDetermine whether it is possible to make $A$ a non-decreasing sequence through the operations.\nYou are given $T$ test cases. Solve each of them.\n\n## Constraints\n\n*   $1 \\leq T \\leq 2 \\times 10^5$\n*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq A_i \\leq 10^9$\n*   The sum of $N$ over all test cases 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. Here, $\\mathrm{case}_i$ denotes the $i$\\-th test case.\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$N$\n$A_1$ $A_2$ $\\dots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc185_b","tags":[],"sample_group":[["3\n3\n1 7 5\n2\n9 0\n10\n607 495 419 894 610 636 465 331 925 724","Yes\nNo\nYes\n\nIn the first test case, you can make $A$ into a non-decreasing sequence by performing the following operations:\n\n*   Choose $(i, j) = (1, 2)$. After the operation, $A$ is $(2, 6, 5)$.\n*   Choose $(i, j) = (1, 2)$. After the operation, $A$ is $(3, 5, 5)$.\n\nIn the second test case, you cannot make $A$ into a non-decreasing sequence no matter how you perform the operations."]],"created_at":"2026-03-03 11:01:13"}}