Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/integer-vaqtga-daqiqa-qoshish

Add minutes to a time

Medium 1000 ms 64 MB 37%
Share

The clock now shows $h$ hours $m$ minutes (in $24$-hour format). Find what it will show in $t$ minutes. At midnight the clock shows $0$ hours $0$ minutes.

Adding minutes to the time on a clock

Input

One line with three integers: $h$, $m$ and $t$.

Output

One line with two integers: hours (from $0$ to $23$) and minutes (from $0$ to $59$).

Note

$0 \le h \le 23$
$0 \le m \le 59$
$0 \le t \le 10^{9}$

Examples

Input #1
9 40 35
Output #1
10 15
Input #2
23 50 15
Output #2
0 5

Sign in to submit a solution

Signing up is free and takes a minute.