DMOPC '15 Contest 4 P2 - The Big Clock

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type
Alert, Nunavut

After a particularly bad ice storm, the central clock from the little town of Alert, Nunavut has frozen, and the hands no longer move.

Since the clock stopped, the locals have been using a stopwatch to determine the current time by adding the stopwatch's current time N (in minutes) with that of the clock. However, adding is a job for computers, so until the clock thaws, they've asked you to help them determine the current time!

Input Specification

The first line of input will contain the space-separated integers H (0 \le H < 24) and M (0 \le M < 60). These integers represent the hour and minutes at which the clock stopped, respectively.
The second line of input will contain the integer N (1 \le N \le 10^9).

Output Specification

Output the current time in 24-hour format, with the hours and minutes separated by a space.

Sample Input 1

11 59
2

Sample Output 1

12 1

Sample Input 2

12 0
61

Sample Output 2

13 1

Sample Input 3

23 58
5

Sample Output 3

0 3

Comments


  • 1
    kukuminer  commented on Jan. 12, 2016, 6:43 p.m. edited

    I know my code isn't the most sophisticated but it's still giving me the correct answers, no matter what I try. Yet I get WA on the 40th and 54th questions. Help?

    EDIT: Well I managed to solve the question properly, and only 4 minutes after my contest time ended. However, I would still like to know what the test cases were that I kept getting wrong.


    • 2
      kobortor  commented on Feb. 8, 2016, 6:33 p.m.

      Some input seem to be out of bounds, on one testcase there was H = 24


  • 6
    moladan123  commented on Jan. 12, 2016, 5:36 p.m.

    Methinks that 100 test cases is slightly excessive, but who knows?


  • 1
    TommyX  commented on Jan. 12, 2016, 12:49 p.m.

    It is possible to understand the question by looking at the Sample Inputs but, from the problem statement I dont know what I am suppose to do and I dont know what H, M and N are. Some clarifications might be helpful. Thanks.


    • 1
      Xyene  commented on Jan. 12, 2016, 12:54 p.m.

      I've clarified the problem statement (it was an oversight).


    • 1
      WallE256  commented on Jan. 12, 2016, 12:54 p.m. edited

      H and M represent the stop time in 24-hour format, and N represents the minutes counted by the stopwatch.

      Edit: Fixed