#C3718. Prefix Sum Array
Prefix Sum Array
Prefix Sum Array
Given an array of integers, your task is to compute the prefix sum array. In other words, for each index i, compute the sum of all elements from index 0 to i.
The prefix sum array \(P\) for an array \(a\) of length \(n\) is defined as:
\[ P_i = \sum_{j=0}^{i} a_j, \quad 0 \le i < n \]If the array is empty, the result is an empty array.
inputFormat
The first line contains a single integer n (\(0 \le n \le 10^5\)), representing the number of elements in the array. The second line contains n integers separated by spaces, representing the elements of the array.
outputFormat
Output a single line containing the prefix sum array. The numbers should be separated by a single space. If the input array is empty, output nothing.
## sample4
1 2 3 4
1 3 6 10