#C12944. Running Sum of a Sequence

    ID: 42427 Type: Default 1000ms 256MiB

Running Sum of a Sequence

Running Sum of a Sequence

Given a sequence of integers, compute the running sum of the sequence. For each index \(i\), the running sum is defined as:

\[ S_i = \sum_{j=1}^{i} a_j \]

The sequence may include negative numbers and can have varying lengths, including an empty sequence. Your task is to print the running sum values separated by a space.

Example:

Input:
5
1 2 3 4 5

Output: 1 3 6 10 15

</p>

inputFormat

The input is read from standard input (stdin). The first line contains a single integer \(n\) which represents the number of elements in the sequence. The next line contains \(n\) integers separated by spaces. If \(n = 0\), then the sequence is empty.

outputFormat

Output the running sum of the sequence to standard output (stdout) as \(n\) integers separated by a space. If the sequence is empty, output nothing.

## sample
5
1 2 3 4 5
1 3 6 10 15