#K6771. Cumulative Sum
Cumulative Sum
Cumulative Sum
Given a list of integers, compute the cumulative sum of the list. The cumulative sum at position i is defined as the sum of all elements from index 0 to i. For example, given the list [1, 2, 3, 4], the cumulative sum is [1, 3, 6, 10].
The mathematical formula for the cumulative sum is given by:
$$ S_i = \sum_{j=0}^{i} a_j $$
Your task is to read the input from standard input and output the cumulative sum list to standard output.
inputFormat
The input is provided via standard input (stdin) in the following format:
The first line contains an integer n, which is the number of elements in the list. The second line contains n space-separated integers.
outputFormat
Output a single line containing the cumulative sum of the list as space-separated integers to standard output (stdout).
## sample4
1 2 3 4
1 3 6 10