There is a rectangular corridor whose width (west–east) is m and whose depth (south–north) is n. Several pillars of negligible size (treated as points) stand inside the corridor, and each pillar rises vertically from the floor to the ceiling.
You want to roll a perfectly spherical ball through the corridor from its west side to its east side. The ball may start anywhere on the west side and may exit at any position on the east side. The corridor is so tall that the ball never touches the ceiling.
Write a program that finds the radius of the largest ball that can pass through the corridor.
The first line contains the corridor's width m and depth n. The second line contains the number of pillars k. Each of the next k lines contains one pillar's coordinates in the form x y, where x is the west–east coordinate and y is the south–north coordinate. (0≤n,m,k≤1000)
The west–east axis points from west to east, so a smaller x is farther west and a larger x is farther east. The south–north axis points from south to north, so a smaller y is farther south and a larger y is farther north. All coordinates are integers, and every pillar lies inside the corridor, so 0≤x≤m and 0≤y≤n.
Print the radius of the largest ball that can pass through the corridor, to eight digits after the decimal point (pad with trailing zeros if needed).