Cuckoo! Cuckoo!

시간 제한1초메모리 제한1024 MB

요약
12시간 시각과 목표 횟수 N이 주어질 때, 뻐꾸기 시계가 정확히 N번 울린 시각을 구한다.
난이도

쉬움10점 중 3점

유형
시뮬레이션, 수학, 구현
정답자
아직 제출이 없습니다

문제

The cuckoo bird pops out of the cuckoo clock and sounds off once on the quarter hour, half hour, and three-quarter hour. At the beginning of each hour, it sounds off the hour (1--12). Given the current time and a target number NN, your task is to determine what time it will be when the cuckoo bird finishes sounding off NN times. If the cuckoo bird would be sounding off at the starting time, include those sounds in the count.

If the count is reached on the hour, report the time at the start of that hour. That is, you may assume the cuckoo finishes sounding off before the minute is up.

입력

The input consists of 2 lines. The first line contains the current time in the form HH:MM where 1≤1 \leq HH ≤12\leq 12 and 0≤0 \leq MM ≤59\leq 59, with leading 0's if necessary. The second line contains a single integer representing the target number NN such that 1≤N≤2001 \leq N \leq 200.

출력

Print the time at which the cuckoo bird has sounded off NN times. The time should be printed in the same format as the input.

예제3

  1. 예제 1

    입력
    02:36
    1
    
    예상 출력
    02:45
    
  2. 예제 2

    입력
    12:00
    13
    
    예상 출력
    12:15
    
  3. 예제 3

    입력
    11:00
    30
    
    예상 출력
    01:00