SDE Path

Row Sums of a Matrix

Easy

Row Sums of a Matrix

Print the sum of each row of a grid.

Input format

The first line has two integers R and C. Each of the next R lines has C space-separated integers describing one row of the matrix.

Output format

Print R integers on one line: the sum of each row, in order from the first row to the last.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
2 3
1 2 3
4 5 6
Expected output
6 15
Example 2
Input
3 2
1 1
2 2
3 3
Expected output
2 4 6