Convert angle to clock timeConvert angle to clock time
Your task is to make a program or function that takes an integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 as input and outputs every possible time (in hours and minutes, no seconds) on an analog clock where the measure of the smaller angle between the hour hand and minute hand is equal to the inputted angle measure.
Rules
- Output can be a list of times, or multiple outputs of times.
- The times can be formatted in any way that can be identifiable as clock times by humans, such as
hh:mm
or a list of the hours and minutes. - Standard loopholes apply.
- This is code-golf, so the shortest code in bytes in each language wins.
Test cases
Input | Output
---------|------------
0 | 12:00
90 | 3:00, 9:00
180 | 6:00
45 | 4:30, 7:30
30 | 1:00, 11:00
60 | 2:00, 10:00
120 | 4:00, 8:00
15 | 5:30, 6:30
135 | 1:30, 10:30
1 | 4:22, 7:38
42 | 3:24, 8:36
79 | 3:02, 8:58
168 | 1:36, 10:24
179 | 1:38, 10:22
Interestingly, there are only two possible times (except for 0 and 180) for every integer (or number with a fractional part of 0.5) degree input and on an analog clock the times represent horizontally flipped images of each other.