Problem F
The Clock
Languages
en
sv
When someone asks you what time it is, most people respond “a quarter past five”, 15:29 or something similar. If you want to make things a bit harder, you can answer with the angle from the minute hand to the hour hand, since this uniquely determines the time. However, most people are not used to this way of specifying the time, so it would be nice to have a program which translates this to a more common format. Your task is to write such a program.
We assume that our clock has no second hand, and only
displays the time at whole minutes (i.e., both hands only move
forward once a minute). The angle is determined by starting at
the hour hand and measuring the number of degrees clockwise to
the minute hand. To avoid decimals, this angle is specified in
tenths of a degree (so that
Input
The input consists of a single integer between
Output
Output the time that the angle corresponds to, in the format hh:mm. We assume that it’s morning, so all times should be between 00:00 and 11:59.
Scoring
Your solution will be tested on three cases. The first two
give you
Sample Input 1 | Sample Output 1 |
---|---|
855 |
01:21 |
Sample Input 2 | Sample Output 2 |
---|---|
3140 |
03:08 |