#C12265. Cumulative Sum Array
Cumulative Sum Array
Cumulative Sum Array
You are given a list of integers. Your task is to compute a cumulative sum array such that the i-th element of the new array is defined by \(S_i = \sum_{j=0}^{i} A_j\), where \(A\) is the original list. In other words, each element in the resulting array is the sum of itself and all previous elements of the input array.
If the input list is empty, the output should also be empty.
This problem requires handling both positive and negative integers, as well as zeros.
inputFormat
The input is given via standard input (stdin) and consists of two lines. The first line contains an integer \(n\) representing the number of elements in the list. The second line contains \(n\) space-separated integers.
If \(n = 0\), the second line may be omitted or empty.
outputFormat
Output the cumulative sum array as a sequence of \(n\) space-separated integers on a single line via standard output (stdout). If \(n = 0\), output nothing.
## sample0