Codeforces Round 937 (Div. 4) |
---|
Finished |
Given the time in 24-hour format, output the equivalent time in 12-hour format.
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1440$$$) — the number of test cases.
The only line of each test case contains a string $$$s$$$ of length $$$5$$$ with format hh:mm representing a valid time in the 24-hour format. hh represents the hour from $$$00$$$ to $$$23$$$, and mm represents the minute from $$$00$$$ to $$$59$$$.
The input will always be a valid time in 24-hour format.
For each test case, output two strings separated by a space ("hh:mm AM" or "hh:mm PM"), which are the 12-hour equivalent to the time provided in the test case (without quotes).
You should output the time exactly as indicated; in particular, you should not remove leading zeroes.
1109:4118:0612:1400:5900:0014:3401:0119:0711:5912:0021:37
09:41 AM 06:06 PM 12:14 PM 12:59 AM 12:00 AM 02:34 PM 01:01 AM 07:07 PM 11:59 AM 12:00 PM 09:37 PM
Name |
---|