#K74222. Calculate Total Practice Time

    ID: 34150 Type: Default 1000ms 256MiB

Calculate Total Practice Time

Calculate Total Practice Time

You are given practice logs for several students. Each student's log consists of a list of practice session durations in the format \(hh:mm:ss\). Your task is to calculate the total practice time for each student and output it in the same \(hh:mm:ss\) format.

The input begins with an integer representing the number of students. For each student, the first line contains the student's name and an integer indicating the number of practice sessions. This is followed by that many lines, each containing a time duration in the format \(hh:mm:ss\).

You must sum the durations for each student and output one line per student with the student's name and the total practice time, separated by a space. Make sure to pad each field with leading zeros to ensure a two-digit format if necessary.

inputFormat

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

N
name1 K1
time1
time2
... (K1 times)
name2 K2
time1
... (K2 times)
...
nameN KN
... (KN times)

Here, the first line contains an integer \(N\) denoting the number of students. For each student, the first line contains the student's name and an integer \(K\) which is the number of practice sessions. The following \(K\) lines each contain a string representing a time duration in the format \(hh:mm:ss\).

outputFormat

The output should be written to standard output (stdout) and consist of \(N\) lines. Each line should contain the student's name and the total practice time (sum of all practice sessions) formatted as \(hh:mm:ss\), separated by a single space.

## sample
3
Alice 5
01:30:00
00:45:00
00:50:00
01:20:00
00:40:00
Bob 3
00:30:00
00:50:00
01:10:00
Charlie 0
Alice 05:05:00

Bob 02:30:00 Charlie 00:00:00

</p>