QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100

#3522. 爵士乐爱好者

统计

Kai 正在听他最喜欢的爵士乐播放列表。他喜欢开启歌曲间的交叉淡入淡出(crossfading)效果,因此在每首歌的最后 $c$ 秒,当前歌曲会缓慢淡出,同时下一首歌曲会淡入。这种效果发生在任意两首连续的歌曲之间,但第一首歌的开头和最后一首歌的结尾会正常播放。

请计算 Kai 听完整个播放列表所需的总时长。

输入格式

输入包含: 两个整数 $n$ 和 $c$ ($1 \le n \le 100, 1 \le c \le 10$),分别表示歌曲数量和交叉淡入淡出的时间(以秒为单位)。 $n$ 行格式为 m:ss ($0:30 \le m:ss \le 9:59$) 的字符串,表示每首歌的长度(分钟部分为一位数字,秒钟部分为两位数字)。

输出格式

输出一个格式为 hh:mm:ss 的字符串,表示听完整个播放列表所需的总时长(小时、分钟和秒钟均以两位数字表示)。

样例

输入 1

3 5
3:59
0:52
9:40

输出 1

00:14:21

输入 2

1 10
6:00

输出 2

00:06:00

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.