#C586. Calculate Total Pages Read

    ID: 49555 Type: Default 1000ms 256MiB

Calculate Total Pages Read

Calculate Total Pages Read

In this problem, you are given the number of participants followed by data for each participant. For every participant, the first number indicates the number of days they have read, and the following numbers indicate the pages read on each day. Your task is to calculate the total number of pages read by each participant.

Input Format:

  • The first line contains an integer \(N\), denoting the number of participants.
  • For each participant, the first number is \(D\) (the number of days), followed by \(D\) integers representing the pages read on each day.

Output Format:

  • Output the total number of pages read by each participant in a single line, separated by a space.

Example:

Input:

3
3
12 15 13
2
10 20
4
5 10 15 20

Output:

40 30 50

Here, the first participant read 12, 15, and 13 pages (total = 40), the second read 10 and 20 pages (total = 30), and the third read 5, 10, 15, and 20 pages (total = 50).

inputFormat

The input is read from standard input (stdin). It begins with an integer \(N\) which indicates the number of participants. Then, for each participant, there is an integer \(D\) representing the number of days, followed by \(D\) space-separated integers that indicate the number of pages read each day.

Example:

3
3
12 15 13
2
10 20
4
5 10 15 20

outputFormat

Output a single line containing \(N\) integers. Each integer represents the total pages read by the corresponding participant, separated by a space.

Example:

40 30 50
## sample
3
3
12 15 13
2
10 20
4
5 10 15 20
40 30 50