#C12143. Cumulative Sum

    ID: 41538 Type: Default 1000ms 256MiB

Cumulative Sum

Cumulative Sum

You are given a list of n integers. Your task is to compute the cumulative sum of the list. In other words, for a given list \(a_1, a_2, \ldots, a_n\), you need to compute a new list \(S\) where each element is defined as:

\(S_i = \sum_{j=1}^{i} a_j\) for \(1 \leq i \leq n\).

The program should read input from standard input (stdin) and print the result to standard output (stdout) following the input and output descriptions below.

inputFormat

The first line contains a single integer n indicating the number of elements in the list.

The second line contains n space-separated integers representing the list elements.

outputFormat

Output a single line containing the cumulative sums of the list, separated by a single space. If the list is empty, output an empty line.

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