Problems
Partial matrix sum
Partial matrix sum
The matrix of integers a[ij]
is given, where 1 ≤ i ≤ n, 1 ≤ j ≤ m. For all i, j find
Input data
The first line contains the matrix size n, m (1 ≤ n, m ≤ 1000). Each of the next n lines contains m integers a[ij]
(1 ≤ a[ij]
≤ 1000).
Output data
Print n rows each containing m numbers S[ij]
.
Examples
Input example #1
3 5 1 2 3 4 5 5 4 3 2 1 2 3 1 5 4
Output example #1
1 3 6 10 15 6 12 18 24 30 8 17 24 35 45