All submissions for this problem are available.
Its monsoon and Mumbai Local Trains have started giving up. Trains which are the lifeline of people in Mumbai, are known for failing during this very beautiful monsoon.
Our friend Rohit comes from a very far place known as Chembur. Travelling from Chembur to our college in Nerul is very hectic for him. You know the struggle is real when trains are not on time.
The speciality of Mumbai Local Trains is, in all their railway stations they have an indicator showing the time of trains and an another indicator to show what is the expected time for that same time.
Sounds weird right?
So, Rohit arrives at some HH:MM and the train is supposed to come at some HH:MM but its actual expected time is in some another HH:MM. Given all these 3 times, can you find out how long Rohit has to wait at station?
There is no such waiting time for Rohit more than 59 minutes
Here HH:MM are standard time i.e. in hours and minutes.
Assume, Rohit always arrives before the train arrives station.
The first line of the input contains T the number of test cases.
Next T lines consist of 3 standard times in HH:MM format. First time denotes the time at which train should have arrived.
Second time denotes the time at which train is expected to arrive (that is arrive late or maybe on time).
Third time denotes the time at which Rohit reaches station.
Each of the following lines contain 3 spaces time as given above. HH:MM is time in standard 24 hour format
Output a single line containing the time in minutes Rohit has to wait at station.
- 1 ≤ T ≤ 100
- 00 ≤ HH ≤ 23
- 00 ≤ MM ≤ 59
Input: 1 08:11 08:13 08:07
Example case 1: Train has to arrive on 08:11 but is going to arrive 2 minutes late. But, Rohit has arrived on platform 4 minutes earlier to original time. So 4+2 = 6 minutes should be shown.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, ADA, ICK, CLPS, ICON, NICE, LUA, BASH, LISP sbcl, LISP clisp, SCM guile, JS, ERL, kotlin, PERL6, CLOJ, FS|
Fetching successful submissions