프로그램 명: boi_escape
제한시간: 1 초

A group of war prisoners are trying to escape from a prison. They have thoroughly planned the escape from the prison itself, and after that they hope to find shelter in a nearby village. However, the village (marked as B, see picture below) and the prison (marked as A) are separated by a canyon which is also guarded by soldiers. These soldiers sit in their pickets and rarely walk; the range of view of each soldier is limited to exactly 100 meters. Thus, depending on the locations of soldiers, it may be possible to pass the canyon safely, keeping the distance to the closest soldier strictly larger than 100 meters at any moment.

You are to write a program which, given the width and the length of the canyon and the coordinates of every soldier in the canyon, and assuming that soldiers do not change their locations, first determines whether prisoners can pass the canyon unnoticed. If this is impossible then the prisoners (having seen enough violence) would like to know the minimum number of soldiers that have to be eliminated in order to pass the canyon safely. A soldier may be eliminated regardless of whether he is visible to any other soldier or not.

입력

Note that passing the canyon may start at coordinate (0, ys) for any 0 ≤ ys ≤ W and end at coordinate (L, ye) for any 0 ≤ ye ≤ W. Neither ys nor ye need to be integer.

출력

In the first and only line of the output file the program should print the minimum number of soldiers that have to be eliminated in order for the prisoners to pass the canyon safely. If the prisoners can escape without any elimination, the program should print 0 (zero).

입출력 예

입력

130 340 5
10 50
130 130
70 170
0 180
60 260

출력

1
Constraints 1 ≤ W ≤ 50,000 1 ≤ L ≤ 50,000 1 ≤ N ≤ 250
출처: boi 2007 

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]