Write a programExercise 4/4Intermediate30 XP

The time a few minutes later

Task

The program reads a time - hours (0 - 23) and minutes (0 - 59) on one line, separated by a space - and on the next line a number of minutes to add (a non-negative whole number, possibly more than a day). It prints the new time as H:MM: always two digits for the minutes (the :02 format helps), and after 23 the hours go back to 0.

For the input

22 45
100

the program prints 0:25.

Examples

  • Input

    22 45
    100

    Expected output

    0:25

After you submit, 6 hidden tests will also check your solution: midnight, nothing added, one minute past midnight, exactly one day, across the hour, more than two days, the minutes come out as 00.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.