#K58572. Convert Minutes to 12-hour Time Format

    ID: 30672 Type: Default 1000ms 256MiB

Convert Minutes to 12-hour Time Format

Convert Minutes to 12-hour Time Format

You are given a single integer NN representing the number of minutes since midnight, where 0N<14400 \leq N < 1440. Your task is to convert these minutes into a time string formatted in the 12-hour clock format with leading zeros for both hours and minutes. Note that midnight is represented as "12:00 AM" and noon as "12:00 PM". Ensure that you handle edge cases such as midnight (0 minutes) and one minute before midnight (1439 minutes) correctly.

inputFormat

The input is provided via standard input (stdin) and consists of a single integer NN, where 0N<14400 \leq N < 1440, representing the minutes passed since midnight.

outputFormat

Output the corresponding time in 12-hour format as a string (HH:MM AM/PM) to standard output (stdout).## sample

0
12:00 AM