TopCoder

User's AC Ratio

100.0% (2/2)

Submission's AC Ratio

50.0% (2/4)

Tags

Description

temmie 正在練習 串接加法。串接加法以 $\boxplus$ 的符號表示,兩個數字運算的結果是兩個數字相接起來後除以 $314159$ 的餘數,例如:$3 \boxplus 2 = 32$、$1234 \boxplus 567 = 292090$。

為了熟悉串接加法,他準備了一個 $n$ 個整數的數列 $a_1, a_2, \ldots a_n$,並定義 $\mathop{\boxplus}\limits_{i=l} ^ {r} a_{i} = ((a_l \boxplus a_{l+1}) \boxplus a_{l+2}) \ldots \boxplus a_r$。他想要計算 $\mathop{\boxplus}\limits_{i=1} ^ {n} a_{i}$,為了有正確答案比較,需要你可以寫一個程式,輸出 $n$ 個數字,其中第 $j$ 個數字是 $\mathop{\boxplus}\limits_{i=1} ^ {j} a_{i}$ 。

Input Format

第一行有一個正整數 $n$,代表陣列的長度。

接下來有 $n$ 以空白相隔的整數 $a_1, a_2, \ldots, a_n$。

測資範圍限制

  • $1 \le n \le 100$
  • $0 \le a_i \le 314158$

Output Format

輸出 $n$ 個以空白隔開的數字,其中第 $j$ 個數字是 $\mathop{\boxplus}\limits_{i=1} ^ {j} a_{i}$。

Sample Input 1

5
1 414 21 35 62

Sample Output 1

1 1414 141421 4980 183903

Hints

Problem Source

Subtasks

No. Testdata Range Score
1 0~4 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 1000 65536 65536 1
3 1000 65536 65536 1
4 1000 65536 65536 1