#K71257. Cumulative Sum of Two Lists
Cumulative Sum of Two Lists
Cumulative Sum of Two Lists
You are given two lists A and B each containing N integers. Your task is to compute a new list C such that for every index i (0-indexed),
In other words, each element C[i] is the cumulative sum of the elements from both lists A and B up to index i.
Example:
Input: 4 1 2 3 4 5 6 7 8</p>Output: 6 14 24 36
inputFormat
The first line contains an integer N representing the number of elements in each list. The second line contains N space-separated integers representing the list A. The third line contains N space-separated integers representing the list B.
outputFormat
Output a single line containing N space-separated integers representing the list C, where each C[i] is the cumulative sum defined as
sample
4
1 2 3 4
5 6 7 8
6 14 24 36