4540: P3957 [NOIP2017 普及组] 跳房子

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

输入 #1
7 4 10
2 6
5 -3
10 3
11 -3
13 1
17 6
20 2

输入 #2
7 4 20
2 6
5 -3
10 3
11 -3
13 1
17 6
20 2

Sample Output Copy

输出 #1
2

输出 #2
-1

HINT