Wall
Once upon a time, there was a greedy King who commanded his chief Architect to construct a wall around his castle. The King, driven by his greed, dismissed the Architect's proposal for a beautifully crafted brick wall with elegant high towers. Instead, he demanded a wall that encircled the entire castle using the least amount of stone possible, while ensuring that the wall maintained a specified minimum distance from the castle. If the King discovered that the Architect used more resources than necessary, the Architect would face dire consequences. Furthermore, the Architect needed to provide a precise calculation of the resources required for the wall.
Your task is to assist the Architect in preserving his life by developing a program that calculates the minimum length of the wall that can be constructed around the castle, adhering to the King's stipulations.
The problem is somewhat simplified by the fact that the King's castle is polygonal and situated on a flat plane. The Architect has already mapped the castle onto a rectangular Cartesian coordinate system and accurately determined the coordinates of each corner of the castle in feet.
Input
The first line contains two integers N and L (3 ≤ N ≤ 1000, 1 ≤ L ≤ 1000), separated by a space: N is the number of corners of the King's castle, and L is the minimum distance in feet that the wall must maintain from the castle.
The following N lines provide the coordinates of the castle's corners in clockwise order. Each line contains two integers x_i and y_i (-10000 ≤ x_i, y_i ≤ 10000), separated by a space, representing the coordinates of the i-th corner in feet. All corners have unique coordinates, and the castle walls do not intersect except at the corners.
Output
Output a single number - the minimum length of the wall in feet that can be constructed around the castle according to the King's requirements. You must provide the King with an integer number of feet, as decimal numbers have not yet been invented. However, the result must be rounded so that it differs by no more than 8 inches from the correct length (1 foot = 12 inches), as the King will not tolerate greater inaccuracy.