a880: Arrival Time
Tags : mathematical reasoning while 多分支 累加
Accepted rate : 15人/16人 ( 94% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-11-16 16:07

Content

Fiona commutes to work each day. If there is no rush-hour traffic, her commute time is 2 hours. However, there is often rush-hour traffic. Specifically, rush-hour traffic occurs from 07:00 (7am) until 10:00 (10am) in the morning and 15:00 (3pm) until 19:00 (7pm) in the afternoon. During rush-hour traffic, her speed is reduced by half. She leaves either on the hour (at XX:00), 20 minutes past the hour (at XX:20), or 40 minutes past the hour (at XX:40). Given Fiona’s departure time, at what time does she arrive at work?

Input

The input will be one line, which contains an expression of the form HH:MM, where HH is one of the 24 starting hours (00, 01, . . ., 23) and MM is one of the three possible departure minute times (00, 20, 40).

Output

Output the time of Fiona’s arrival, in the form HH:MM.

Sample Input #1
05:00
Sample Output #1
07:00
Sample Input #2
07:00
Sample Output #2
10:30
Sample Input #3
23:20
Sample Output #3
01:20
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (6%): 1.0s , <1K
公開 測資點#1 (6%): 0.625s , <1K
公開 測資點#2 (6%): 0.625s , <1K
公開 測資點#3 (6%): 0.625s , <1K
公開 測資點#4 (6%): 0.625s , <1K
公開 測資點#5 (6%): 0.625s , <1K
公開 測資點#6 (6%): 0.625s , <1K
公開 測資點#7 (6%): 0.625s , <1K
公開 測資點#8 (6%): 0.625s , <1K
公開 測資點#9 (6%): 0.625s , <1K
公開 測資點#10 (6%): 0.625s , <1K
公開 測資點#11 (6%): 0.625s , <1K
公開 測資點#12 (7%): 0.625s , <1K
公開 測資點#13 (7%): 0.625s , <1K
公開 測資點#14 (7%): 0.625s , <1K
公開 測資點#15 (7%): 0.625s , <1K
Hint :
Tags:
mathematical reasoning while 多分支 累加
出處:
CCC2016 [管理者:
issin@g.puic... (冼一心老師)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」