#K81637. Cumulative Sum

    ID: 35798 Type: Default 1000ms 256MiB

Cumulative Sum

Cumulative Sum

Given a list of integers, compute the cumulative sum list where the \(i\)-th element is the sum of the first \(i\) elements from the list. For example, if the input list is [1, 2, 3, 4], then the cumulative sum is [1, 3, 6, 10].

Your task is to read the input from standard input and output the cumulative sums as space-separated numbers on a single line.

inputFormat

The first line contains a single integer \(n\) which represents the number of elements in the list. The second line contains \(n\) space-separated integers.

outputFormat

Output the cumulative sum as a sequence of space-separated integers on a single line. If \(n = 0\), output an empty line.

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