oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

clocktime Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

clocktime.html

Problem Description

These few days, Rar the Cat has been playing with twines for such a long time that he has completely forgotten to study! Thus, his parents, being very strict cats, has punished Rar the Cat to be locked up in a windowless room for N seconds.

Due to the fact that N can be a very large number, Rar the Cat wants to know what time it would be when he finally gets to leave the room. Given the time Rar the Cat begins his confinement period in 24-hour time, output the time in which Rar will end his confinement period.

Input

The first line of input will contain three integers, the hour, minute and second of the 24-hour time Rar the Cat begins the confinement period.
The second line of input will contain one integer, N.

Output

Your output should contain three integers, the hour, minute and second of the 24-hour time Rar the Cat ends his confinement period.
Your output should be terminated with a newline.

Limits

Subtask 1 (8%): 1 ≤ N ≤ 50
Subtask 2 (15%): 1 ≤ N ≤ 50 000
Subtask 3 (23%): 1 ≤ N ≤ 1 000 000
Subtask 4 (54%): 1 ≤ N ≤ 1 000 000 000 000
Subtask 5 (0%): As per sample testcases

Sample Input 1

0 0 0
6

Sample Output 1

0 0 6

Sample Input 2

23 59 59
1

Sample Output 2

0 0 0

Tags

Ad Hoc

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
18211s32MBMinimum
215211s32MBMinimum
323211s32MBMinimum
454211s32MBMinimum
5021s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o clocktime -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.