#C6812. Row Cumulative Matrix
Row Cumulative Matrix
Row Cumulative Matrix
You are given a matrix with n rows. Your task is to transform each row of the matrix into its cumulative sum form. For each row, the cumulative sum is defined as:
\( S_j = a_{j1} + a_{j2} + \cdots + a_{jj} \) for each element in the row, where \(a_{ji}\) is the i-th element of the j-th row.
Note: The number of integers in each row may vary.
Input: The input is read from standard input (stdin).
Output: For each row, output the row cumulative sums separated by a single space. Each row's output should be printed on a new line to standard output (stdout).
inputFormat
The first line of input contains an integer \( n \) representing the number of rows in the matrix. Each of the next \( n \) lines contains space-separated integers representing the elements of that row.
outputFormat
For each row of the matrix, output a single line containing the cumulative sums of that row. Numbers in a line should be separated by a single space.
## sample3
1 2 3 4
5 6 7 8
9 10 11 12
1 3 6 10
5 11 18 26
9 19 30 42
</p>