#P15228. [SWERC 2017] Blowing Candles

[SWERC 2017] Blowing Candles

Problem Description

As Jacques-Édouard really likes birthday cakes, he celebrates his birthday every hour, instead of every year. His friends ordered him a round cake from a famous pastry shop, and placed candles on its top surface. The number of candles equals the age of Jacques-Édouard in hours. As a result, there is a huge amount of candles burning on the top of the cake. Jacques-Édouard wants to blow all the candles out in one single breath.

You can think of the flames of the candles as being points in the same plane, all within a disk of radius R R (in nanometers) centered at the origin. On that same plane, the air blown by Jacques-Édouard follows a trajectory that can be described by a straight strip of width W W , which comprises the area between two parallel lines at distance W W , the lines themselves being included in that area. What is the minimum width W W such that Jacques-Édouard can blow all the candles out if he chooses the best orientation to blow?

Input Format

The first line consists of the integers N N and R R , separated with a space, where N N is Jacques-Édouard’s age in hours. Then N N lines follow, each of them consisting of the two integer coordinates xi x_i and yi y_i of the i i th candle in nanometers, separated with a space.

Output Format

Print the value W W as a floating point number. An additive or multiplicative error of 10−5 10^{-5} is tolerated: if y y is the answer, any number either within [y−10−5;y+10−5] [y - 10^{-5}; y + 10^{-5}] or within [(1−10−5)y;(1+10−5)y] [(1 - 10^{-5})y; (1 + 10^{-5})y] is accepted.

3 10
0 0
10 0
0 10
7.0710678118654755

Hint

Limits

  • 3≤N≤2⋅105 3 \leq N \leq 2 \cdot 10^5 ;
  • 10≤R≤2⋅108 10 \leq R \leq 2 \cdot 10^8 ;
  • for 1≤i≤N 1 \leq i \leq N , xi2+yi2≤R2 x_i^2 + y_i^2 \leq R^2 ;
  • all points have distinct coordinates.