Watch

3.2

5 votes
Problem

My watch was correct at midnight, after which it began to lose N minutes per hour, until D hours ago it stopped completely. It now shows the time as H:M, i.e. 13:20, H=13, M=20.


TASK:
Write a program that will display the correct time now.


INPUT:
N minutes per hour, D hours, incorrect time (H:M)


OUTPUT:
Correct time (H:M)

(NOTE: For the wrong inputs, if there are any, display “ERROR!” and end the program. The time should be in a military time, i.e. 22:17.)

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?