#P10409. 「QFOI R2」水落溪流浅浅
「QFOI R2」水落溪流浅浅
Problem Description
Xiao R is a cute girl. One night at o'clock, when she was submitting homework, she found that the deadline was 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 hours long. The only difference is that the daily time range changes from to . Specifically, for times between in the 24-hour system, the representation stays the same. After of the next day, the date stays unchanged, and the hour part of the time keeps increasing until it reaches of the next day.
For example, the table below shows some corresponding times:
| -hour system | -hour system |
|---|---|
| Year Month Day | |
| Year Month Day | |
| Year Month Day | |
| Year Month Day | Year Month Day |
| Year Month Day | Year Month Day |
| Year Month Day | |
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 .
is within the range , 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