2014 Mock CCC by Alex and Timothy
Alice had just dug up an old time capsule that she had buried in her backyard many years ago. Inside, she discovered an exquisite clock from when she was a young girl. When she buried the clock, she had removed the batteries so that the hands would remain in that position forever. This was done so she could remind her future self of the exact time at which she met her eternal love interest — Bob. Unfortunately, all but the o'clock marking had worn away over the years. With a protractor handy, Alice is determined to find out the exact time that Bob came into her life.
Measuring the hour hand from the centre of the clock, Alice determined that it was degrees clockwise from the o'clock marking. Alice then measured the angle of the minute hand, determining that it was degrees clockwise relative to the hour hand. Finally, she measured the second hand, determining that it was degrees clockwise relative to the minute hand. The three angle measurements will all be non-negative real numbers greater than or equal to , but less than . You may assume that the angles will yield valid times.
Input Specification
Three lines, containing the three values , , and .
Output Specification
Output the time, in the format HH:MM:SS
, where
is the number of hours, is the number of
minutes, and is the number of seconds. These
values each must be padded to two digits with leading zeros. Round the
time to the nearest second.
Sample Input 1
195
345
180
Sample Output 1
06:30:00
Sample Input 2
90.066667
270.733333
47.200000
Sample Output 2
03:00:08
Explanation
The following diagrams depict Alice's clock for the examples above. Orange is the hour hand, black is the minute hand, and red is the second hand.
Comments