## Happy New Year!

View as PDF

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

A popular meme that's been going around on the internet goes like this:

If you start <some something> at <some time> on <some day>, then you'll be able to <some other thing> as the clock strikes midnight. Kick off 2018 the right way.

Given that this certain "some something" takes hours, minutes, and seconds, find this certain "some time".

#### Input Specification

Three space-separated integers, , , and , respectively.

#### Output Specification

The time of day when you should start the task, in the form hours:minutes:seconds. Note that this time should follow the 12-hour clock convention, with all leading zeroes, including the hours. You should not print out am or pm though.

EDIT: If the time is 12:??:??, you should output 00:??:??.

#### Sample Input 1

0 34 5

#### Sample Output 1

11:25:55

#### Sample Input 2

0 120 0

#### Sample Output 2

10:00:00

#### Sample Input 3

13 0 0

#### Sample Output 3

11:00:00

• commented on Dec. 9, 2019, 1:39 p.m.

Can someone help me work through why some tests are failing?

I'm giving fixed output formatting so it will always display in ??:??:?? format. I'm guessing that for some reason I'm failing on the tests where hours are > 12 but I don't actually know why, when I try to supply values the expected output is returned. I have a hardcoded change so that if hours == 00, hours = 12 as per the edit.

• commented on Oct. 14, 2019, 9:40 p.m. edited

Somebody helps we what's wrong with my code QAQ

• commented on Oct. 14, 2019, 10:33 p.m.

When the time needed to perform the task is converted to seconds the value may exceed so it cannot be stored as an int.

• commented on Oct. 14, 2019, 10:51 p.m.

Ohhhh, Thank You!