CF967A Mind the Gap
题目描述
最近 Arkady 在一个大型机场当空中交通管理员.他管理着一条用于飞机降 落的跑道。因此,他的手中有一份当天的飞机降落时刻表。每架飞机需要一分钟 来降落。(即:从给定的时间持续一分钟)
现在有一架飞机要插队。这架飞机也需要一分钟来降落,但是为了安全,它 的降落前后应该有一段时间的空缺,前后各 s 分钟。
请你找到最早的可以安排插队的时间。
输入格式
第一行输入两个整数 n 和 s。(1
输出格式
最早的时间,同样以h m形式输出;
注:
如果在第一架飞机之前就可以加入,输出0 0;
如果只能在最后加入,h可以大于24;
感谢@shzr 提供的翻译
说明/提示
In the first example note that there is not enough time between 1:20 and 3:21, because each landing and the takeoff take one minute.
In the second example there is no gaps in the schedule, so Arkady can only add takeoff after all landings. Note that it is possible that one should wait more than $ 24 $ hours to insert the takeoff.
In the third example Arkady can insert the takeoff even between the first landing.