Problem C: Time Travel
Jim and John are twins. Jim is an astronaut, and John buys
really cheap watches.
Jim and John each have analog watches (i.e., 12-hour time with
hour, minute and second hands, where all hands move continuously
around the face of the watch).
Jim will be flying out into space at a velocity approaching the
speed of light, and so his watch will run slow by a seconds per day.
John just bought a really cheap battery for his fake Rolex, and it
will run slow by b seconds per day.
Suppose Jim and John sync up their watches to midnight as Jim's
spacecraft hits its terminal velocity.
What time will the watches show when next they have exactly the same time?
Input Specification
Input consists of a number of lines, each with two distinct
non-negative integers
a and b between
0 and 256, indicating the number of seconds per day that
each watch loses.
Output Specification
For each line of input, print a, b, and the time displayed on each watch,
rounded to the nearest minute. Valid times range from
01:00 to 12:59
Sample Input
1 2
0 7
2 13
Output for Sample Input
1 2 12:00
0 7 10:17
2 13 04:22