Input
The times when the machine flashes a light are given in each line in the HH:MM format; hours only go from 1 to 12 because this is an analog clock.
Also remember, because this is an analog clock, the hour hand moves between the hour marks when the time is not a full hour (between 4:00 and 5:00 o’clock, for example).
A hash sign ’#’ indicates End Of File.
Output
Each line is the acute (smaller) angle between the hands (colored green in the image below), as an absolute value, rounded to one decimal place. It does not matter which hand is on the right or left.
Input
07:23 02:22 04:00 06:15 #
Output
83.5 61.0 120.0 97.5