No.652 E869120 and TimeZone
Problem Statement
E869120 is currently in Japan. The current time is $b$ minutes past $a$ o'clock. Japan time is "UTC+9".
square1001 is currently in a certain country. The time zone of that country is $S$. S is given in the format "UTC+X" , "UTC-X", "UTC+X.X", or "UTC-X.X".
What is the local time, in hours and minutes, at the place where square1001 is?
Note that the cases include time zones that do not exist in reality.
Input
a b S
- $0≦a≦23$
- $0≦b≦59$
- If $a$,$b$ have one digit, they are given with a leading 0.
- $S$ is given in the format "UTC+X", "UTC-X", "UTC+X.X", or "UTC-X.X".
- The time difference has at most 1 digit after the decimal point. Inputs with 2 or more digits after the decimal point are not given.
- The time difference from $UTC$ is within $±14$.
Output
Print the local time on one line in 24-hour notation, in a format like "02:20". Do not forget the newline at the end.
Sample
Sample 1
Input
22 20 UTC+8
Output
21:20
In Beijing time, 22:20 Japan time is 21:20.
Sample 2
Input
22 20 UTC+12
Output
01:20
In Kamchatka time, 22:20 Japan time is 01:20.
Sample 3
Input
00 05 UTC+8.5
Output
23:35
In North Korea time before May 2018, 00:05 Japan time is 23:35.
Sample 4
Input
12 00 UTC-4
Output
23:00
In New York time, 12:00 Japan time is 23:00.
Sample 5
Input
09 00 UTC+11.5
Output
11:30
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
e869120