Daniel has built a clock that he wants to hang in his apartment so that he will miss the bus less often in the future. However, hands and digits were too boring for him. Therefore, he equipped his clock with words. Daniel has already soldered the circuit and assembled the case. Proudly, he sends you a picture of his clock. But then he realizes that he has to hurry to catch his bus in time for his lecture. And yet, the software for the clock is not finished! Can you complete the software for Daniel's clock?
Daniel's clock contains the words HALF, TEN, QUARTER, TWENTY, FIVE, MINUTES, PAST, TO, and O'CLOCK to indicate the minutes of the time. To represent the hours, the clock contains the words ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, ELEVEN, and TWELVE. Additionally, the clock always displays the word IT'S. It is not possible to use words intended for representing hours to represent minutes.
Daniel can only display times on his clock where the minutes are divisible by five. Therefore, the minutes of the current time should always be rounded down to the last multiple of five. For example, 03:20, 03:22, and 03:24 all become IT'S TWENTY MINUTES PAST THREE. Only at 03:25 does the clock switch to IT'S TWENTY FIVE MINUTES PAST THREE.
The first line of the input specifies the number of test cases to process (1 ≤ N ≤ 1440). Each subsequent line contains one test case: Each test case consists of a time in the 24-hour format HH:MM. The newline character \n is used as a line break.
For each test case, a line with words describing the time of the test case must be output. All words must be in uppercase letters. The newline character can be \n or \r\n.
4 19:33 16:04 03:22 03:59
IT'S HALF PAST SEVEN IT'S FOUR O'CLOCK IT'S TWENTY MINUTES PAST THREE IT'S FIVE MINUTES TO FOUR
Please log in to submit a question...
Please log in to submit a solution...