The Very Last Minute

Worth 3 point(s) - Runtime Limit: 1 seconds


Whoops! Someone designed this problem at the very last minute. Cutting it close! But how close?

Given a deadline and a starting time, write a program that finds the difference in hours and minutes.


Input starts with a line containing \(N\), the number of test cases. Each test case consists of two lines, one for a deadline and one for a starting time. The deadline will always fall after the starting time. Each line consists of a time-stamp (in military time), and day of the month separated by a space.

9:00 25
7:20 25
16:00 13
16:00 12
2:00 14
22:00 2


Print out the time difference between deadline and starting time in hours and minutes.

1 hours 40 minutes
24 hours 0 minutes
268 hours 0 minutes