Baltic OI '12 P2 - Mobile

View as PDF

Submit solution


Points: 15 (partial)
Time limit: 0.6s
Memory limit: 64M

Problem types
Baltic Olympiad in Informatics: 2012 Day 1, Problem 2

The well-known mobile network operator Totalphone has set up a number of new base transceiver stations in order to cover a newly-built highway with its network. As always the programmers of Totalphone have been sloppy; as a result, the transmission power cannot be set up individually for the stations, but one can only set the transmission power to a fixed common value for all the stations. In order to minimize power consumption, the company wants to know the maximal distance of a point on the highway to the nearest base transceiver station.

Constraints

1 \le N \le 10^6

1 \le L \le 10^9

|x_i|, |y_i| \le 10^9

Subtask 1 [25%]

1 \le N \le 5\,000

Subtask 2 [25%]

1 \le N \le 10^5

Subtask 3 [50%]

No additional constraints.

Input Specification

The first line of input contains two space-separated integers N and L representing the number of base transceiver stations and the length of the highway, respectively.

N lines follow, each containing a pair of integers x_i and y_i, which describes the coordinates of a base transceiver station. All points are distinct. Coordinates are sorted in the non-decreasing order with respect to x_i coordinates. If two values of x_i are the same, then coordinates are sorted with respect to y_i coordinates in increasing order.

The highway is a straight line ranging from (0, 0) to (L, 0).

Output Specification

The only line of output should contain a single number - the maximal distance of a point on the highway to the nearest base transceiver station. Your output will be regarded as correct if it is within an absolute error of 10^{-3} of the correct answer.

Sample Input

2 10
0 0
11 1

Sample Output

5.545455

Comments

There are no comments at the moment.