#K36402. Digital Clock Simulation
Digital Clock Simulation
Digital Clock Simulation
You are given a starting time in the format (hh:mm:ss) and a non-negative integer (t) representing the number of seconds. Your task is to simulate a digital clock which prints the time every second starting from the given time. The clock should run for (t+1) seconds (including the starting time) and must correctly handle the rollover from (23:59:59) to (00:00:00).
inputFormat
The input consists of two lines:
- The first line contains a string representing the start time in the format (hh:mm:ss).
- The second line contains an integer (t), representing the number of seconds to run the simulation.
outputFormat
Output (t+1) lines. Each line should contain the time in (hh:mm:ss) format, starting from the initial time and incrementing by one second. The clock rolls over correctly after (23:59:59).## sample
23:59:55
10
23:59:55
23:59:56
23:59:57
23:59:58
23:59:59
00:00:00
00:00:01
00:00:02
00:00:03
00:00:04
00:00:05
</p>