#97Easy
Add seconds to a time
Time: 1 s · Memory: 256 MB
- Functions
Statement
Write a function IncTime(h, m, s, t) that adds seconds to a time given in hours, minutes and seconds. The time wraps around within a day: :: plus second is ::.
Input format
A single line with four integers , , , (, , ).
Output format
A single line with three numbers: the new hours, minutes and seconds.
Examples
Input
2 6 40 7600
Output
4 13 20
Input
23 59 59 1
Output
0 0 0
Note
The simplest way is to convert the time to seconds: , take the remainder modulo and split it back into hours, minutes and seconds. In the first example: 4 13 20.
