International Meeting
Time limit1sMemory limit256 MB
Convert a HH:MM meeting time from one UTC offset to N coworker offsets and print each local time of day.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Zoyi Corporation has branches all over the world. YJ leads a project there and works with coworkers overseas, but he writes the meeting time only in his own time zone. His secretary MH rewrote the mail so that every recipient reads the meeting time in local time.
MH wrote down each coworker's time zone as an offset from Coordinated Universal Time (UTC). Korea is UTC+9 and New Jersey is UTC-5. One branch uses UTC+8.5, so the offset is not always an integer. is a multiple of 0.5 and satisfies .
Given the meeting time written in YJ's time zone and the time zones of coworkers, find the meeting time in each coworker's local time.
Input
The first line contains an integer (), the number of coworkers.
The second line contains the meeting time in YJ's time zone in the format HH:MM UTC+D. A single space separates the time from the offset.
Each of the next lines contains one coworker's time zone in the format UTC+D.
Times use the 24-hour clock. Noon is 12:00, midnight is 00:00, and the last minute of a day is 23:59. Midnight is never written as 24:00. An offset always carries a sign, and a zero offset is written UTC+0.
Output
Print lines. Line contains the meeting time converted to coworker 's local time in the format HH:MM, with two digits for the hour and two digits for the minute. Print only the time of day, even when the conversion moves to another date.