Problems > Clock Plus K Minutes

Clock Plus K Minutes

Difficulty: 1000 2000 ms 128 MB

implementation

The time is HH:MM on a 24-hour clock. What time will it show K minutes later?

Input: one line with three integers H M K.

Output: the new time as HH:MM (both two digits).

Constraints:

  • 0 ≤ H ≤ 23
  • 0 ≤ M ≤ 59
  • 0 ≤ K ≤ 109

Sample Tests

Input 1
23 30 45
Output 1
00:15
Input 2
0 0 1440
Output 2
00:00

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.