So, your response must be in this interval as well (i.e. no nap can start before 10:00 and last after 18:00).
The appointment can be any sequence of characters, but will always be in the same line. You can assume that no line will be longer than 255 characters, that 10 ≤ hh ≤ 18 and that 0 ≤ mm < 60.
You CAN'T assume, however, that the input will be in any specific order. You must read the input until you reach the end of file.
For each test case, you must print the following line:
Day #d: the longest nap starts at hh : mm and will last for [H hours and] M minutes.
Where d stands for the number of the test case (starting from 1) and hh : mm is the time when the nap can start. To display the duration of the nap, follow these simple rules:
Notice that you don't have to worry with concordance (i.e. you must print '1 minutes' or '1 hours' if it's the case).
The duration of the nap is calculated by the difference between the ending time free and the begining time free. That is, if an appointment ends at 14:00 and the next one starts at 14:47, then you have (14:47)-(14:00) = 47 minutes of possible nap.
If there is more than one longest nap with the same duration, print the earliest one. You can assume that there won't be a day all busy (i.e. you may assume that there will be at least one possible nap).