2009 Bulgarian Olympiad in Informatics
There is a dangerous minefield somewhere in Bulgaria. You have been assigned to enclose them all with a "warning band" so that future travellers are aware of the danger.
After searching around with a metal detector, you have located all of
the mines. Each mine is a perfectly round shape with radius at
location
,
. Can you write a program to determine the length of
the shortest band that will enclose all of the mines?
Input Specification
On the first line of the standard input, two integers and
will be
given - the number of the mines and their radius. On the next
lines, the
coordinates
and
of the center of a mine will be given. The mines
will overlap (in order to create a more powerful blast, for example).
will be between
and
, inclusive, and
,
will be between
and
.
Output Specification
Output a single line, containing the minimal length of a band.
Your answer will be considered correct if it is within of the
answer.
Sample Input
8 1
1 4
3 2
7 9
5 4
9 5
6 7
9 1
11 8
Sample Output
34.408
Comments