Happy New Year!

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Problem type

A popular meme that's been going around on the internet goes like this:

If you start <some something> at <some time> on <some day>, then you'll be able to <some other thing> as the clock strikes midnight. Kick off 2018 the right way.

Given that this certain "some something" takes h hours, m minutes, and s seconds, find this certain "some time".


0 \le h,m,s \le 10^9

Input Specification

Three space-separated integers, h, m, and s, respectively.

Output Specification

The time of day when you should start the task, in the form hours:minutes:seconds. Note that this time should follow the 12-hour clock convention, with all leading zeroes, including the hours. You should not print out am or pm though.

EDIT: If the time is 12:??:??, you should output 00:??:??.

Sample Input 1

0 34 5

Sample Output 1


Sample Input 2

0 120 0

Sample Output 2


Sample Input 3

13 0 0

Sample Output 3



There are no comments at the moment.