-->
当前位置:首页 > 题库

PROGRAMMING:Jazz enthusiast

Luz5年前 (2021-05-10)题库452
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.
Kay is listening to his favorite jazz. He likes to turn on the cross fade between songs, so that in the last few seconds of one song, it will fade in and the next one will fade 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.
This happens between any two consecutive songs, but the beginning of the first song and the end of the last song will play normally.
Determine the total amount of time it takes Kai to listen to the whole player.
###Input format:
• 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).
Two integers n and C (1 ≤ n ≤ 100, 1 ≤ C ≤ 10), giving the number of songs and cross fading time (seconds).
The length of the song is given in the form of M: SS (0:30 ≤ M: SS ≤ 9:59) in N lines (one digit is the number of whole minutes, two digits is the remaining seconds).
###Output format:
Output a string of the form HH: mm: SS, giving the total time it takes to listen through the whole player (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), Gives the total time spent on the entire play list (two numbers for the entire hours, two numbers for the entire minutes remaining, and two numbers for the seconds remaining).
###Input sample 1:
```in
3 5
3:59
0:52
9:40
```
###Output sample 1:
```out
00:14:21
```
###Input sample 2:
```in
1 10
6:00
```
###Output sample 2:
```out
00:06:00
```






answer:If there is no answer, please comment