{"problem":{"name":"Inverse Prefix Sum","description":{"content":"You are given an integer $N$ and a sequence $S=(S_1,\\ldots,S_N)$ of length $N$. Find a sequence $A=(A_1,\\ldots,A_N)$ of length $N$ that satisfies the following condition for all $k=1,\\ldots,N$: *   $","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc280_b"},"statements":[{"statement_type":"Markdown","content":"You are given an integer $N$ and a sequence $S=(S_1,\\ldots,S_N)$ of length $N$.\nFind a sequence $A=(A_1,\\ldots,A_N)$ of length $N$ that satisfies the following condition for all $k=1,\\ldots,N$:\n\n*   $A_1+A_2+\\ldots+A_k = S_k$.\n\nSuch a sequence $A$ always exists and is unique.\n\n## Constraints\n\n*   $1 \\leq N \\leq 10$\n*   $-10^9\\leq S_i \\leq 10^9$\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$S_1$ $\\ldots$ $S_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc280_b","tags":[],"sample_group":[["3\n3 4 8","3 1 4\n\nThe sequence in the output actually satisfies all the conditions:\n\n*   $A_1=3=S_1$;\n*   $A_1+A_2=3+1=4=S_2$;\n*   $A_1+A_2+A_3=3+1+4=8=S_3$."],["10\n314159265 358979323 846264338 -327950288 419716939 -937510582 97494459 230781640 628620899 -862803482","314159265 44820058 487285015 -1174214626 747667227 -1357227521 1035005041 133287181 397839259 -1491424381"]],"created_at":"2026-03-03 11:01:14"}}