#P6077. [BalticOI 2007] Escape
[BalticOI 2007] Escape
Problem Description
War criminals are trying to escape from prison. They have carefully planned how to get out of the prison itself, and after leaving the prison they hope to find cover in a nearby village.
Between the village (B in the figure below) and the prison (A in the figure) there is a canyon, and the canyon is also guarded by soldiers. The soldiers guarding the canyon sit on watchtowers and rarely move. Each soldier has an observation range of meters. The soldiers’ positions determine whether the war criminals can pass through the canyon safely. The condition for a safe passage is that at any moment, the distance from the war criminals to the nearest soldier is greater than meters.
Given the length and width of the canyon and the coordinates of each soldier in the canyon, assuming the soldiers’ positions remain unchanged, write a program to determine whether the war criminals can pass through the canyon without being spotted.
If they cannot, output the minimum number of soldiers that must be eliminated so that they can pass safely (a soldier can be eliminated regardless of whether they are seen by another soldier).

Input Format
The first line contains three integers , , and , representing the length of the canyon, the width of the canyon, and the number of soldiers.
The next lines each contain two integers and , representing the coordinates of the -th soldier in the canyon. Coordinates are in meters. The southwest corner of the canyon is and the northeast corner is , as shown in the figure above.
Note: Passing through the canyon means going from (where satisfies ) to (where satisfies ). Here and do not have to be integers.
Output Format
Output a single integer: the number of soldiers that must be eliminated to pass through the canyon safely. If no soldiers need to be eliminated, output .
130 340 5
10 50
130 130
70 170
0 180
60 260
1
Hint
For of the testdata: , , , , .
Translated by ChatGPT 5