#P1513. Enclosing Circular Nails

    ID: 14799 Type: Default 1000ms 256MiB

Enclosing Circular Nails

Enclosing Circular Nails

You are given N cylindrical nails on a plane, each with a radius R. The centers of these nails form the vertices of a convex polygon. You need to use a rope (which has negligible thickness) to enclose all the nails. The rope must wrap tightly around the nails.

Since each nail is circular, the rope will follow an offset of the polygon by a distance of R. Therefore, the total length of the rope is given by:

\( L = P + 2\pi R \)

where \(P\) is the perimeter of the convex polygon formed by the centers of the nails.

inputFormat

The first line contains two numbers: an integer N (the number of nails) and a real number R (the radius of each nail).

Each of the following N lines contains two real numbers representing the x and y coordinates of a nail's center. The given points form a convex polygon (though they may not be in order).

outputFormat

Output the length of the rope required, rounded to 2 decimal places.

sample

3 1
0 0
0 1
1 0
9.70

</p>