Time Until the Warning
InterviewTime limit1sMemory limit128 MB
Given current time and a future warning time in a day, compute the wait time as a difference modulo 24 hours, printing 24:00:00 if they match.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
You are given the current time and the time when a warning will begin. Both times are times within a 24-hour day.
Compute how long you must wait until the warning begins. The waiting time is at least 1 second and at most 24 hours. Therefore, if the two times are the same, wait until the same time on the next day and output 24:00:00.
Input
The first line contains the current time in the format hh:mm:ss.
The second line contains the warning time in the same format.
hh is an integer from 0 to 23, and mm and ss are each integers from 0 to 59.
Output
Print the required waiting time in the format hh:mm:ss. If the required wait is 24 hours, print 24:00:00.