#P10409. 「QFOI R2」水落溪流浅浅

    ID: 11722 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>洛谷原创O2优化洛谷月赛分支结构

「QFOI R2」水落溪流浅浅

Problem Description

Xiao R is a cute girl. One night at 2323 o'clock, when she was submitting homework, she found that the deadline was 00 o'clock of the same day (midnight). To avoid this tragedy happening again, she introduced to you the "30-hour system".

In the 30-hour system, a day is still 2424 hours long. The only difference is that the daily time range changes from 00:0023:5900:00\sim 23:59 to 06:0029:5906:00\sim 29:59. Specifically, for times between 06:0023:5906:00\sim 23:59 in the 24-hour system, the representation stays the same. After 00:0000:00 of the next day, the date stays unchanged, and the hour part of the time keeps increasing until it reaches 06:0006:00 of the next day.

For example, the table below shows some corresponding times:

2424-hour system 3030-hour system
20242024 Year 22 Month 1313 Day 06:0006:00
20242024 Year 22 Month 1313 Day 12:0012:00
20242024 Year 22 Month 1313 Day 18:0018:00
20242024 Year 22 Month 1414 Day 00:0000:00 20242024 Year 22 Month 1313 Day 24:0024:00
20242024 Year 22 Month 1414 Day 05:5905:59 20242024 Year 22 Month 1313 Day 29:5929:59
20242024 Year 22 Month 1414 Day 06:0006:00

Now you are given a time in the 24-hour system. Convert it to the 30-hour system.

Since Xiao R also thinks handling leap years is troublesome, you do not need to tell her the date. You only need to tell her the time.

Input Format

One line with one string in the format hh:mm, representing a time in the 24-hour system. In particular, if the hour or minute has fewer than two digits, leading zeros will be added to make it two digits.

Output Format

One line with one string in the format hh:mm, representing the corresponding time in the 30-hour system. If the hour or minute has fewer than two digits, you also need to add leading zeros to make it two digits. You do not need to consider whether the date changes.

14:00
14:00
09:07
09:07
03:22
27:22

Hint

Explanation for Sample 11.

14:0014:00 is within the range 06:0023:5906:00\sim 23:59, so the representation stays unchanged.


Constraints.

This problem does not use bundled testdata.

For all data: the input is guaranteed to be a valid 24-hour time as specified in the [Input Format].


Hint.

The table in the [Description] provides more usable samples.

Translated by ChatGPT 5