#P1513. 绕钉子的长绳子

绕钉子的长绳子

Description

There are NN cylindrical nails on the plane, each with radius RR. The centers of all nails form a convex polygon.

Now you need to use a rope to enclose these nails. The rope’s diameter is negligible. Find the length of the rope.

Input Format

The first line contains two numbers: an integer NN (1N1001 \le N \le 100) and a real number RR.

The next NN lines give the coordinates of the NN nail centers in counterclockwise order.

The absolute value of each coordinate does not exceed 100100.

Output Format

Output one number: the length of the rope, to 22 decimal places.

4 1
0.0 0.0
2.0 0.0
2.0 2.0
0.0 2.0

14.28

Hint

This problem is from URAL 1020, translation from NOCOW.

Translated by ChatGPT 5