{"problem":{"name":"Sum of Three Terms","description":{"content":"You are given a sequence of $N$ integers $S = (S_1, \\ldots, S_N)$. Determine whether there is a sequence of $N+2$ integers $A = (A_1, \\ldots, A_{N+2})$ that satisfies the conditions below. *   $0\\leq","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc135_b"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of $N$ integers $S = (S_1, \\ldots, S_N)$. Determine whether there is a sequence of $N+2$ integers $A = (A_1, \\ldots, A_{N+2})$ that satisfies the conditions below.\n\n*   $0\\leq A_i$ for every $i$ ($1\\leq i\\leq N+2$).\n*   $S_i = A_{i} + A_{i+1} + A_{i+2}$ for every $i$ ($1\\leq i\\leq N$).\n\nIf it exists, print one such sequence.\n\n## Constraints\n\n*   $1\\leq N\\leq 3\\times 10^5$\n*   $0\\leq S_i\\leq 10^9$\n\n## Input\n\nInput is given from Standard Input from the following format:\n\n$N$\n$S_1$ $\\ldots$ $S_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc135_b","tags":[],"sample_group":[["5\n6 9 6 6 5","Yes\n0 4 2 3 1 2 2\n\nWe can verify that $S_i = A_i + A_{i+1} + A_{i+2}$ for every $i$ ($1\\leq i\\leq N$), as follows.\n\n*   $6 = 0 + 4 + 2$.\n*   $9 = 4 + 2 + 3$.\n*   $6 = 2 + 3 + 1$.\n*   $6 = 3 + 1 + 2$.\n*   $5 = 1 + 2 + 2$."],["5\n0 1 2 1 0","No"],["1\n10","Yes\n0 0 10"]],"created_at":"2026-03-03 11:01:14"}}