Prime Cut 5


Kirby has to set up a space station to survey a set of nn stars, each of which has a distinct position (xi,yi)(x_i, y_i). To set up a space station, Kirby must choose a position on a cut in spacetime. This cut is a line segment that begins at position (s,0)(s, 0) and ends at (e,0)(e,0), meaning that kirby can choose any position on the x axis between ss and ee for his space station.

The space station will send out a light beam to each star sequentially, starting with star 11, then 22, ... until it sends a signal to star nn. When the station sends out a signal to a star ii, it takes did_i seconds to reach the star, where did_i is the distance to the star from the space station. the signal then takes did_i seconds to travel back to the space station. Only then can the station send a signal to star i+1i+1.

The amount of time taken to send and receive a signal from every star is a period, and can be expressed as 2d1+2d2+2d3...+2dn2d_1 + 2d_2 + 2d_3 ... + 2d_n. Kirby wants to maximise the number of signals sent to stars, so he wants to choose a position for his station such that the period is small as possible. What is the smallest period that can be achieved?

hint: functions of the form f(x)=(x−a)/sqrt((x−a)2+b2)f(x) = (x-a)/ sqrt((x-a)^2 + b^2) are monotonically increasing.

Input

The first line has 3 integers n,s,e,(1≤n≤1e5)(−1e5≤s,e≤1e5)n, s, e, (1 \le n \le 1e5) (-1e5 \le s, e \le 1e5), the number of stars, and the start and end points of the cut in spacetime.

nn lines follow, each with xiyix_i y_i, the coordinates of a star −1e5≤xi,yi≤1e5 -1e5 \le x_i, y_i \le 1e5.

All points are distinct and guaranteed to not be all collinear.

Output

Write the smallest possible period that occurs when kirby chooses the optimal location for a space station

Sample Input

Input 1
2 -1000 1000
1 1
2 2

Output 1
6.32455532
Input 2
1 -2000 1000
5 5

Output 2
10
Input 3
7 -10 0
8 3
10 1
0 2
0 8
7 2
0 0
5 10

Output 3
94.10865829

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.