Logo
(追記) (追記ここまで)

34429번 - Late Larry 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB174716941.818%

문제

Larry is a hard-working and honest programmer, who has been one of the most productive engineers in his company. His bosses are even looking to promote him... but there is a problem: Larry is always late. Larry's bosses recently told him that if he does not improve his promptness he will not be promoted.

Larry asks you to help him get to his appointments on time. He tells you that he never knows when to leave for meetings and appointments, though he admits he always knows how many minutes it will take to get to the meeting. Luckily he never has to travel more than 24ドル$ hours from where he is for a meeting; however, if the meeting is far away, he may have to leave the day before to arrive at his meeting on time.

입력

  • The first line contains the scheduled time of the meeting.

    The scheduled meeting time is in the format "$h$:$m$ $d$", where $h$ is the hour of the day (1ドル\leq h\leq 12$) and $m$ is the number of minutes (0ドル \leq m < 60$). $m$ (an integer) is always given as two digits (i.e., left-padded with zeros), but $h$ (also an integer) is not left-padded with zeros if it is only one digit. Finally $d$ is either "AM" or "PM".

  • The second line contains the time it takes Larry to arrive at the meeting. This time is an integer number of minutes $t$ (1ドル\leq t \leq 1440 = 24*60$).

출력

Output the time Larry will need to leave in order to make his appointment or meeting on time. The output should be in the format "$h$:$m$ $d$" (like the input), where $h$ is the hour of the day (1ドル\leq h\leq 12$) and $m$ is the number of minutes (0ドル \leq m < 60$). $m$ (an integer) is always given as two digits (i.e.,\ left-padded with zeros) but $h$ (also an integer) is not left-padded with zeros. Finally $d$ should be "AM" or "PM".

제한

예제 입력 1

4:30 PM
52

예제 출력 1

3:38 PM

예제 입력 2

12:22 PM
88

예제 출력 2

10:54 AM

노트

출처

School > CS@Mines > CS@Mines HSPC 2020 F번

  • 문제를 만든 사람: Jared Lincenberg
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /