#K88572. Warehouse Row Capacity Calculation

    ID: 37338 Type: Default 1000ms 256MiB

Warehouse Row Capacity Calculation

Warehouse Row Capacity Calculation

You are given a warehouse represented as a grid with $r$ rows and $c$ columns. Each cell in the grid contains a non-negative integer representing the capacity of a shelf (i.e. the number of packages that can be stored in that shelf).

Your task is to compute and output the total capacity of each row in the warehouse. In other words, for each row, you need to sum up the capacities of all its shelves.

Input Format: The first line contains two integers $r$ and $c$. The next $r$ lines each contain $c$ integers representing the capacity values of that row.

Output Format: Output a single line with $r$ integers, where each integer is the calculated total capacity for the corresponding row. The numbers should be separated by a single space.

inputFormat

The input is given via standard input (stdin) and has the following structure:

  • The first line contains two integers $r$ (number of rows) and $c$ (number of columns).
  • The following $r$ lines each contain $c$ integers separated by spaces. Each integer represents the capacity of the warehouse shelf at that cell.

outputFormat

Output a single line via standard output (stdout) which contains $r$ integers. Each integer is the sum of the capacities in the corresponding row of the grid, and the integers should be separated by a single space.

## sample
3 3
4 0 2
1 3 0
0 0 1
6 4 1