P28574 [洛谷] [SDOI2012] Save Princess Yun
提高-
题目描述

Problem Description

The hero is once again embarking on a journey to save the princess...

This time, the target of the rescue is the beloved and righteous Princess Yun.

The hero arrives at the entrance of the boss's cave and is immediately stunned, for in front of him is not just one boss, but thousands of them. Realizing that he is still at level 1, he understands that this is an impossible task.

However, he is not willing to give up. He wonders if it's possible to avoid the bosses and rescue the princess, hehe.

The boss's cave can be seen as a rectangle, with the hero at the bottom left corner (1,1) and the princess at the top right corner (row, line). To avoid the bosses, the hero decides to find a path that maximizes the shortest distance to any boss.

Ps: The hero can move in any direction but cannot leave the bounds of the rectangle. This means the hero can reach any point within the rectangle (not necessarily an integer point).

Can you help him?

When the hero finds the beautiful and lovely Princess Yun, he is immediately surrounded by the bosses!!! The hero closes his eyes, raises his hand gently, and with a flash of white light, he uses a teleport scroll to return to the castle, but only Princess Yun returns... because the hero forgot to enter the teleportation circle.

Input Format

The first line contains three integers: n, the number of bosses, row, and line, which represent the size of the rectangle.

The next n lines each contain two integers representing the coordinates of a boss.

Output Format

Output a decimal number, representing the maximum shortest distance of the hero's path to any boss, accurate to two decimal places.

Sample Input and Output

Sample Input #1

1 3 3
2 2

Sample Output #1

1.00

Sample Input #2

1 3 3
3 1

Sample Output #2

2.00

Notes

Data Range:

20% of the data, the boss coordinate range is less than or equal to 50.

60% of the data, n <= 1500.

100% of the data, n <= 3000.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 3 3 2 2
样例输出
1.00