Late Larry
시간 제한1초메모리 제한2048 MB
12시간 형식의 약속 시각과 이동 시간(분)이 주어질 때, 래리가 출발해야 하는 시각을 12시간 형식으로 출력한다.
문제
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 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 ": ", where is the hour of the day () and is the number of minutes (). (an integer) is always given as two digits (i.e., left-padded with zeros), but (also an integer) is not left-padded with zeros if it is only one digit. Finally 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 ().
출력
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 ": " (like the input), where is the hour of the day () and is the number of minutes (). (an integer) is always given as two digits (i.e.,\ left-padded with zeros) but (also an integer) is not left-padded with zeros. Finally should be "AM" or "PM".