#C8712. Compute Total Lines of Code

    ID: 52725 Type: Default 1000ms 256MiB

Compute Total Lines of Code

Compute Total Lines of Code

This problem requires you to process daily coding records for a set of employees. Each record contains an employee's name, the number of days they worked, and a list of integers representing the number of lines of code produced on each day. The input concludes with a line containing "END".

Your task is to compute and output, for each employee, the total number of lines of code written over the given period. Each result should display the employee's name and the computed total separated by a space.

The number of days provided for each employee is simply used to indicate how many numbers follow, and the sum of these numbers is the desired output.

inputFormat

The input is read from standard input (stdin) and consists of multiple records. Each record has the following format:

  • An employee name (a string).
  • An integer D which indicates the number of days.
  • A line with D integers separated by spaces representing the lines of code written each day.

The sequence of records ends with a line containing the string "END".

outputFormat

For each employee record, output a single line to standard output (stdout) containing the employee's name and the total lines of code written, separated by a single space.

## sample
John
3
100 150 200
END
John 450