Your task is to make a program or function that takes a nonnegative integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 (inclusive) 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, a string of the times with separators, 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. - The times should be from 12:00 to 11:59 (e.g.
0:00
and22:00
are invalid outputs). - 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
115 | 1:50, 10:10
Interestingly, there are only two possible times in hours and minutes (except for 0 and 180 degrees) 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.
10:10
/10:09
as testcases! :D \$\endgroup\$