Clock
InterviewTime limit1sMemory limit1024 MB
Given the angle between the hour and minute hands in tenths of a degree, print the morning time that produces it as hh:mm.
- Level
Easy3 of 10
- Topics
- Math, Implementation, Brute force
- Solved
- No attempts yet
Problem
If someone asks what time it is, most people answer with something like quarter past five or 15:29. To make it harder, you can instead answer with the angle between the hour hand and the minute hand, since that angle alone determines the time uniquely. Many people are not used to telling time this way, so a program that converts it into a more common format would be useful. Write such a program.

The clock on the left shows 01:21 and the one on the right shows 03:08.
Assume the clock has no second hand and shows only a whole number of minutes, so both hands jump forward only on whole minutes. The angle is measured from the hour hand clockwise to the minute hand (see the figure). To avoid decimals, the angle is written in tenths of a degree, so degrees is written as . This value is always an integer from to inclusive, and since only whole minutes are shown, it is always divisible by .
Input
The input is a single integer, the angle between the two hands in tenths of a degree. It is between and inclusive.
Output
Print the time that corresponds to the angle in the format hh:mm. If the hour has one digit, still print a leading zero. Assume it is morning, so every time lies between 00:00 and 11:59 inclusive.