Museum wall construction
Time limit1sMemory limit256 MB
Find the shortest closed curve enclosing N disjoint equal circles of radius R.
Problem
Hongjun is extremely rich, and one day he takes an interest in art. He decides to build a museum with his money.
The floor of the museum is flat. For aesthetic reasons he stands cylindrical pillars on the floor, each perpendicular to it, and every pillar has the same radius . The outer wall is made of glass so thin that its thickness is ignored, and it also stands perpendicular to the floor, so seen from above the wall is a single closed curve.
The wall must enclose every pillar. Hongjun wants the wall that uses the least glass. Compute the length of that wall.
Input
The first line contains two natural numbers and separated by a space (, ). is the number of pillars and is the radius shared by all of them.
Each of the next lines contains two integers and separated by a space, the coordinates of one pillar center when the floor is viewed as the plane (). No two pillars overlap or touch.
Output
Print the minimum length of a wall that encloses every pillar, rounded to six digits after the decimal point, on one line.