{"problem":{"name":"± Increasing Sequence","description":{"content":"You are given a sequence of length $N$, $A = (A_1, \\ldots, A_N)$, consisting of $1$ and $-1$. Determine whether there is an integer sequence $x = (x_1, \\ldots, x_N)$ that satisfies all of the followin","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc153_c"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of length $N$, $A = (A_1, \\ldots, A_N)$, consisting of $1$ and $-1$.\nDetermine whether there is an integer sequence $x = (x_1, \\ldots, x_N)$ that satisfies all of the following conditions, and print one such sequence if it exists.\n\n*   $|x_i| \\leq 10^{12}$ for every $i$ ($1\\leq i\\leq N$).\n*   $x$ is strictly increasing. That is, $x_1 < \\cdots < x_N$.\n*   $\\sum_{i=1}^N A_ix_i = 0$.\n\n## Constraints\n\n*   $1\\leq N\\leq 2\\times 10^5$\n*   $A_i \\in \\lbrace 1, -1\\rbrace$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc153_c","tags":[],"sample_group":[["5\n-1 1 -1 -1 1","Yes\n-3 -1 4 5 7\n\nFor this output, we have $\\sum_{i=1}^NA_ix_i= -(-3) + (-1) - 4 - 5 + 7 = 0$."],["1\n-1","Yes\n0"],["2\n1 -1","No"]],"created_at":"2026-03-03 11:01:13"}}