#P1427H. Prison Break

    ID: 5617 Type: RemoteJudge 4000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>binary searchgamesgeometryternary search*3500

Prison Break

No submission language available for this problem.

Description

A prisoner wants to escape from a prison. The prison is represented by the interior of the convex polygon with vertices P1,P2,P3,,Pn+1,Pn+2,Pn+3P_1, P_2, P_3, \ldots, P_{n+1}, P_{n+2}, P_{n+3}. It holds P1=(0,0)P_1=(0,0), Pn+1=(0,h)P_{n+1}=(0, h), Pn+2=(1018,h)P_{n+2}=(-10^{18}, h) and Pn+3=(1018,0)P_{n+3}=(-10^{18}, 0).

The prison walls Pn+1Pn+2P_{n+1}P_{n+2}, Pn+2Pn+3P_{n+2}P_{n+3} and Pn+3P1P_{n+3}P_1 are very high and the prisoner is not able to climb them. Hence his only chance is to reach a point on one of the walls P1P2,P2P3,,PnPn+1P_1P_2, P_2P_3,\dots, P_{n}P_{n+1} and escape from there. On the perimeter of the prison, there are two guards. The prisoner moves at speed 11 while the guards move, remaining always on the perimeter of the prison, with speed vv.

If the prisoner reaches a point of the perimeter where there is a guard, the guard kills the prisoner. If the prisoner reaches a point of the part of the perimeter he is able to climb and there is no guard there, he escapes immediately. Initially the prisoner is at the point (1017,h/2)(-10^{17}, h/2) and the guards are at P1P_1.

Find the minimum speed vv such that the guards can guarantee that the prisoner will not escape (assuming that both the prisoner and the guards move optimally).

Notes:

  • At any moment, the guards and the prisoner can see each other.
  • The "climbing part" of the escape takes no time.
  • You may assume that both the prisoner and the guards can change direction and velocity instantly and that they both have perfect reflexes (so they can react instantly to whatever the other one is doing).
  • The two guards can plan ahead how to react to the prisoner movements.

The first line of the input contains nn (1n501 \le n \le 50).

The following n+1n+1 lines describe P1,P2,,Pn+1P_1, P_2,\dots, P_{n+1}. The ii-th of such lines contain two integers xix_i, yiy_i (0xi,yi1,0000\le x_i, y_i\le 1,000) — the coordinates of Pi=(xi,yi)P_i=(x_i, y_i).

It is guaranteed that P1=(0,0)P_1=(0,0) and xn+1=0x_{n+1}=0. The polygon with vertices P1,P2,,Pn+1,Pn+2,Pn+3P_1,P_2,\dots, P_{n+1}, P_{n+2}, P_{n+3} (where Pn+2,Pn+3P_{n+2}, P_{n+3} shall be constructed as described in the statement) is guaranteed to be convex and such that there is no line containing three of its vertices.

Print a single real number, the minimum speed vv that allows the guards to guarantee that the prisoner will not escape. Your answer will be considered correct if its relative or absolute error does not exceed 10610^{-6}.

Input

The first line of the input contains nn (1n501 \le n \le 50).

The following n+1n+1 lines describe P1,P2,,Pn+1P_1, P_2,\dots, P_{n+1}. The ii-th of such lines contain two integers xix_i, yiy_i (0xi,yi1,0000\le x_i, y_i\le 1,000) — the coordinates of Pi=(xi,yi)P_i=(x_i, y_i).

It is guaranteed that P1=(0,0)P_1=(0,0) and xn+1=0x_{n+1}=0. The polygon with vertices P1,P2,,Pn+1,Pn+2,Pn+3P_1,P_2,\dots, P_{n+1}, P_{n+2}, P_{n+3} (where Pn+2,Pn+3P_{n+2}, P_{n+3} shall be constructed as described in the statement) is guaranteed to be convex and such that there is no line containing three of its vertices.

Output

Print a single real number, the minimum speed vv that allows the guards to guarantee that the prisoner will not escape. Your answer will be considered correct if its relative or absolute error does not exceed 10610^{-6}.

Samples

Sample Input 1

2
0 0
223 464
0 749

Sample Output 1

1

Sample Input 2

3
0 0
2 2
2 4
0 6

Sample Output 2

1.0823922

Sample Input 3

4
0 0
7 3
7 4
5 7
0 8

Sample Output 3

1.130309669

Sample Input 4

5
0 0
562 248
460 610
281 702
206 723
0 746

Sample Output 4

1.148649561

Sample Input 5

7
0 0
412 36
745 180
747 184
746 268
611 359
213 441
0 450

Sample Output 5

1.134745994