Blowing Candles
Time limit4sMemory limit512 MB
Given up to 200,000 points inside a disk, find the minimum width of a strip that can cover all of them.
- Level
Hard8 of 10
- Topics
- Geometry, Brute force, Sorting, Divide and conquer
- Solved
- No attempts yet
Problem

Jacques-Édouard likes birthday cakes so much that he celebrates his birthday every hour instead of every year. His friends ordered a round cake from a famous pastry shop and placed candles on its top surface. The number of candles equals his age in hours, so a huge number of candles are burning on the cake. Jacques-Édouard wants to blow all of them out in one single breath.
Think of the flames as points in one plane, all inside a disk of radius nanometers centered at the origin. In that same plane, the air he blows travels along a straight strip of width , which is the region between two parallel lines at distance . Both lines belong to that region. Find the minimum width that lets him blow out every candle when he chooses the best orientation.
Input
The first line has the integers and , separated by a space, where is Jacques-Édouard's age in hours. Each of the next lines has the two integer coordinates and of the -th candle in nanometers, separated by a space.
Limits
- for every with
- All points have distinct coordinates.
Output
Print on one line, rounded to exactly six digits after the decimal point. For example, print 20.000000 when the answer is .