305109: CF967A. Mind the Gap
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Mind the Gap
题意翻译
题目描述: 最近 Arkady 在一个大型机场当空中交通管理员.他管理着一条用于飞机降 落的跑道。因此,他的手中有一份当天的飞机降落时刻表。每架飞机需要一分钟 来降落。(即:从给定的时间持续一分钟) 现在有一架飞机要插队。这架飞机也需要一分钟来降落,但是为了安全,它 的降落前后应该有一段时间的空缺,前后各 s 分钟。 请你找到最早的可以安排插队的时间。 输入格式: 第一行输入两个整数 n 和 s。(1<=n<=100,1<=s<=60)。 注:n架飞机; 接下来的n行 即为每架飞机降落的时间,以h m形式给出(0<=h<=23,0<=m<=59)。(小时,分钟) 输出格式: 最早的时间,同样以h m形式输出; 注: 如果在第一架飞机之前就可以加入,输出0 0; 如果只能在最后加入,h可以大于24; 感谢@shzr 提供的翻译题目描述
These days Arkady works as an air traffic controller at a large airport. He controls a runway which is usually used for landings only. Thus, he has a schedule of planes that are landing in the nearest future, each landing lasts $ 1 $ minute. He was asked to insert one takeoff in the schedule. The takeoff takes $ 1 $ minute itself, but for safety reasons there should be a time space between the takeoff and any landing of at least $ s $ minutes from both sides. Find the earliest time when Arkady can insert the takeoff.输入输出格式
输入格式
The first line of input contains two integers $ n $ and $ s $ ( $ 1 \le n \le 100 $ , $ 1 \le s \le 60 $ ) — the number of landings on the schedule and the minimum allowed time (in minutes) between a landing and a takeoff. Each of next $ n $ lines contains two integers $ h $ and $ m $ ( $ 0 \le h \le 23 $ , $ 0 \le m \le 59 $ ) — the time, in hours and minutes, when a plane will land, starting from current moment (i. e. the current time is $ 0 $ $ 0 $ ). These times are given in increasing order.
输出格式
Print two integers $ h $ and $ m $ — the hour and the minute from the current moment of the earliest time Arkady can insert the takeoff.
输入输出样例
输入样例 #1
6 60
0 0
1 20
3 21
5 0
19 30
23 40
输出样例 #1
6 1
输入样例 #2
16 50
0 30
1 20
3 0
4 30
6 10
7 50
9 30
11 10
12 50
14 30
16 10
17 50
19 30
21 10
22 50
23 59
输出样例 #2
24 50
输入样例 #3
3 17
0 30
1 0
12 0
输出样例 #3
0 0