#C5505. Task Completion Times

    ID: 49162 Type: Default 1000ms 256MiB

Task Completion Times

Task Completion Times

You are given n tasks, and each task is composed of k subtasks. The duration of each subtask is provided. All subtasks in a task must be completed sequentially (i.e. a task's subtasks are executed one after another in the given order). Your job is to determine the total completion time for each task.

In other words, for each task, compute the sum of the durations of its k subtasks.

Note: The robots can only process one subtask at a time per task. There is no parallel processing between subtasks of a single task.

The formula for each task is given by:

\(T_i = \sum_{j=1}^{k} d_{ij}\), where \(d_{ij}\) is the duration of the j-th subtask in the i-th task.

inputFormat

The input is read from standard input (stdin) in the following format:

  1. The first line contains two space-separated integers: n (the number of tasks) and k (the number of subtasks per task).
  2. The following n lines each contain k space-separated positive integers, representing the duration of each subtask for that task.

outputFormat

Output a single line containing n space-separated integers representing the completion time of each task in the order they were given.

## sample
3 2
5 3
2 4
8 1
8 6 9