시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 0 0 0 0.000%

문제

Kai is listening to his favourite jazz playlist. He likes to turn on crossfading between songs, so during the last seconds of a song, it will slowly fade out while the next one fades in. This happens between any two consecutive songs, but the beginning of the first song and the end of the last song will be played normally.

Determine the total amount of time it takes Kai to listen to the whole playlist.

입력

The input consists of:

  • Two integers n and c (1 ≤ n ≤ 100, 1 ≤ c ≤ 10), giving the number of songs and the crossfade time in seconds.
  • n lines of the form m:ss (0:30 ≤ m:ss ≤ 9:59), giving the song lengths (with one digit for the number of whole minutes and two digits for the remaining seconds).

출력

Output a string of the form hh:mm:ss, giving the total time it takes to listen through the whole playlist (with two digits for the number of whole hours, two digits for the number of remaining whole minutes, and two digits for the remaining seconds).

예제 입력 1

3 5
3:59
0:52
9:40

예제 출력 1

00:14:21

예제 입력 2

1 10
6:00

예제 출력 2

00:06:00