CLOCK:
Author: Tushar Kadam
Tester: Sangram Desai
Editorialist: Tushar Kadam
DIFFICULTY:
SIMPLE
PREREQUISITES:

Understanding of Normal 12 hr clock.
PROBLEM:
Given time in HH MM SS format and you have to find what will be time after hour hand moves by x degrees.
EXPLANATION:
If hour hand moves by 1 degree then 2 minutes will happen in 12 hour clock. As x is integer and smallest change in x can be only 1 degree hence
second hand will come to its original position whatever may be the value of x i.e SS field will not change.
Now find if minutes to add in MM field is greater than 60 or not . If final MM field > 60 then add extra minutes in hour by converting minutes to
hour.
Note : if x > 360 that means hour hand has moved by more than 360 degrees i.e several complete rotations have happened.
so to solve one can do x = x%360 which will have same effect.
Possible testcases where you may get wrong answers:
input :
6
11 58 59 1
11 59 1 1
12 58 55 28
11 2 23 29
11 2 0 361
11 59 27 62
output:
12 0 59
12 1 1
1 54 55
12 0 23
11 4 0
2 3 27
AUTHOR’S AND TESTER’S SOLUTIONS:
Author’s solution Java Solution
Tester’s solution Python Solution.