A common piece of orienteering knowledge is that the time of day, position of the sun, and compass direction are all related: knowing the first two allows you to calculate the third.
To do this, one must note that sun’s compass angle changes roughly uniformly throughout the day. In the northern hemisphere, the sun is located due North ( degrees) at midnight, due East ( degrees) at am, due South ( degrees) at noon, and due West ( degrees) at pm. Hence, if you pick an arbitrary direction, measure the angle of the sun with respect to that direction, and subtract the angle of the sun with respect to North at the current time of day, you obtain the angle that North makes with that direction.
Given the angle of the sun with respect to some direction and the current time, find the angle that North makes with respect to that direction.
Input Specification
The input contains the sun angle and the time in hour format.
Output Specification
Output the angle of North, rounded to the nearest integer.
Sample Input 1
180 12:00
Sample Output 1
0
Sample Input 2
90 03:00
Sample Output 2
45
Comments