Salt Bomb
InterviewTime limit2sMemory limit512 MB
Given two clock times, compute how long the arm waits, treating an earlier target as the next day; print the wait in hh:mm:ss.
- Level
Easy3 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
After failing a chemistry exam, Cheolsu decided to play a trick on his chemistry teacher.
Cheolsu hid a homemade robotic arm on the teacher's desk. He wants to program it so that at a fixed moment the arm dumps a pile of salt into the water cup the teacher always drinks from.
Cheolsu knows the current time and the time the salt should drop, but he is bad at arithmetic and cannot work out the waiting time to enter into the arm. Given the two times, find how long the arm has to wait.
Input
The first line contains the current time in hh:mm:ss format. The hour is between and , the minute and the second are each between and , and every value is padded to two digits.
The second line contains the salt drop time in the same format.
Output
Print on one line the waiting time from the current time to the salt drop time, in hh:mm:ss format. Pad every value to two digits.
If the salt drop time is earlier than the current time, it refers to that time on the next day. The waiting time is at least second and at most hours, so print 24:00:00 when the two times are equal.