#K91932. Prefix Sum Array

    ID: 38085 Type: Default 1000ms 256MiB

Prefix Sum Array

Prefix Sum Array

Given a list of integers, your task is to compute the prefix sum (also known as the cumulative sum) of the list. For each index i in the list, the prefix sum is defined as:

\( p_i = \sum_{j=1}^{i} a_j \)

where \(a_j\) represents the element at position \(j\) in the array. The result should be an array of the same length where each element is the sum of all previous elements including the current one.

Input Format: The first line contains an integer N representing the number of elements in the list. The second line contains N space-separated integers.

Output Format: Output the prefix sum array as a single line of space-separated integers.

Example:

Input:
5
1 2 3 4 5

Output: 1 3 6 10 15

</p>

inputFormat

The input consists of two lines. The first line contains a single integer N (1 ≤ N ≤ 105), the number of elements in the array. The second line contains N space-separated integers \(a_1, a_2, \ldots, a_N\) where each \(a_i\) satisfies \(|a_i| \leq 10^9\).

outputFormat

Output a single line with the prefix sum array, i.e., the cumulative sums of the input array. The numbers should be separated by a single space.

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