cswork / OA打开练习工作台

Arista NetworksOA #1

Generate Matrix B

估计简单可在线判题

考点(AI 标注)前缀和区间

In row-major order, write the prefix sums of the flattened matrix A back into a matrix B of the same size.

This site's standard I/O format and supplementary bounds follow this problem's statement.

输入格式

The first line contains m n (1≤m,n≤1000, mn≤2×10^5), followed by m lines of n integers each (−10^9≤Aij≤10^9).

输出格式

Output m lines, each with n prefix sums.

样例 1

输入:

2 3
1 2 3
4 5 6

输出:

1 3 6
10 15 21

样例 2

输入:

1 1
-7

输出:

-7

样例 3

输入:

1 1
-3

输出:

-3