2502.The Time

Time Limit: 1s Memory Limit: 256MB

You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes.

Note that you should find only the time after a minutes, see the examples to clarify the problem statement.

You can read more about 24-hour format here https://en.wikipedia.org/wiki/24-hour_clock.

Input Format(From the terminal/stdin)

The first line contains the current time in the format hh:mm (0 \le hh \lt 24,0 \le mm \lt 60). The hours and the minutes are given with two digits (the hours or the minutes less than 10 are given with the leading zeroes).

The second line contains integer a (0 \le a \le 104) - the number of the minutes passed.

Output Format(To the terminal/stdout)

The only line should contain the time after a minutes in the format described in the input. Note that you should print exactly two digits for the hours and the minutes (add leading zeroes to the numbers if needed).

See the examples to check the input/output format.

Sample Input 1

Copy
23:59
10
     \n
  \n

Sample Output 1

Copy
00:09
     \n

Sample Input 2

Copy
20:20
121
     \n
   \n

Sample Output 2

Copy
22:21
     \n

Sample Input 3

Copy
10:10
0
     \n
 \n

Sample Output 3

Copy
10:10
     \n

Submit

请先 登录

© 2025 FAQs