University of Lethbridge - Mathematics & Computer Science

Problem #4 What time is it?

At exactly 12:00 Midnight, the center lines of the hour hand, the minute hand and the second hand of a standard 12-hour analog clock are coincident. They all point in the same direction perfectly aligned.

At exactly what other times between 12:00 Midnight and 12:00 Noon are the hour and minute hands also exactly coincident? Compute these times to the nearest hundredth of a second. Output, to a file clock.out, the times in chronological order one per line in the following format:

HH:MM:SS.SS

For the hours, suppress leading zeros and replace them with spaces. For minutes and seconds show the leading zeros. For example, 6 minutes, 7.42 seconds after 2:00 would be printed as:

 2:06:07.42
And 9 minutes and 1.55 seconds before 11:00 would appear as:
10:50:58.45
THE CLOCK IS TICKING!!!!


Original problem: Rocky Mountain Region ACM contest, 1991