#BS0000432. Qua lối đi hẹp (Fatman)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Qua lối đi hẹp (Fatman)
Fatman
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
A person wants to travel from the left end of an aisle to the right end despite the obstacles scattered inside it. Viewed from above, the person is modeled as a rigid disk, while each obstacle is an infinitesimally small point.
The aisle has length and width . Two parallel walls run along the aisle at and . There are obstacles, with obstacle at inside or on the boundary of the aisle. The person can change direction freely, but the disk must not cross a wall or an obstacle. A disk of diameter cannot pass between two obstacles whose distance is less than . The same clearance is required between an obstacle and a wall. Contact with a wall or obstacle is allowed.
Find the largest disk diameter that still permits travel from the left end of the aisle to the right end.
The following diagram shows the obstacle positions in the example.

Input
The first line contains two integers , the length and width of the aisle.
The second line contains an integer , the number of obstacles.
Each of the next lines contains two integers , the coordinates of obstacle ().
Output
Print one line in the format Maximum size in test case 1 is M. replacing M with the largest possible diameter rounded to exactly four digits after the decimal point. Preserve capitalization, spaces and the final period.
Subtasks
- Subtask 1 (20 points): ; ; , for all .
- Subtask 2 (30 points): ; ; , for all . All obstacles have the same -coordinate.
- Subtask 3 (50 points): ; ; , for all .
Examples
Input
8 5
8
2 1
1 3
3 2
4 4
5 3
6 4
7 2
7 1
Output
Maximum size in test case 1 is 2.2361.
Explanation
The aisle is five units wide and eight units long, with eight obstacles. The relevant clearances are distances between obstacles and distances from obstacles to each wall.
For diameters at most , gaps of width remain passable. The obstacles connected to the lower wall through gaps strictly smaller than are ; the others are near the upper wall. No gap between the two groups is strictly smaller than , so there is no blocking chain across the aisle.
For any diameter greater than , the obstacles form a blocking chain between the walls. Its successive gaps have widths , , and . They are all smaller than the diameter, making the chain impassable.
The greatest diameter is , which rounds to 2.2361.