#C10976. Digital Clock Simulation

    ID: 40240 Type: Default 1000ms 256MiB

Digital Clock Simulation

Digital Clock Simulation

You are given the current time on a digital clock and a number of minutes to add. Your task is to compute the new time after adding the given minutes. The clock uses a 24-hour format. For example, if the current time is 23:45 and you add 80 minutes, the new time will be 01:05.

The process can be expressed with the formulas below:

\(total\_minutes = hour \times 60 + minutes + to\_add\)

\(new\_hour = \left(\frac{total\_minutes}{60}\right) \bmod 24\)

\(new\_minutes = total\_minutes \bmod 60\)

Output the new time in the format "HH:MM", using zero-padding if necessary.

inputFormat

The input consists of a single line containing three integers separated by spaces:

  • hour: the current hour (0 ≤ hour ≤ 23)
  • minutes: the current minute (0 ≤ minutes ≤ 59)
  • to_add: the number of minutes that need to be added.

For example: 23 45 80

outputFormat

Output a single line containing the new time after adding the given minutes, formatted as "HH:MM" (with leading zeroes if needed).

## sample
23 45 80
01:05