1864: Rope
内存限制:256 MB
时间限制:1.000 S
评测方式:文本比较
命题人:
提交:3
解决:3
题目描述
Plotters have barberically hammered N nails into an innocent plane shape, so that one can see now only heads. Moreover, pursuing their mean object, they have hammered all the nails into the vertices of a convex polygon. After that they…it is awful… have roped off the nails, so that the shape felt upset (the rope was very thin). They’ve done it as it is shown in the figure.
大意:一些很粗的钉子钉在一个平面上,然后在外围用绳子把它围成一个凸多边形。
Your task is to find out a length of the rope.
问题是求绳子的长度
输入
There two numbers in the first line of the standard input: N ― a number of nails (1 <= N <= 100), and a real number R ― a radius of heads of nails. All the heads have the same radius. Further there are N lines, each of them contains a pair of real coordinates (separated by a space) of centers of nails. An absolute value of the coordinates doesn’t exceed 100. The nails are described in a clockwise order starting from an arbitrary nail. Heads of different nails don’t adjoin.
第一行有2个数,第一个为N (1 <= N <= 100) ,钉子的个数,第二个为实数R,钉子的半径。所有的钉子都具有相同的半径。接下来的N行,每一行为一对实数,用空格隔开,描述钉子的中心坐标。坐标的绝对值不超过100。是从任一个钉子开始,按照顺时针方向描钉子的坐标的。不同的钉子不会相连。
第一行有2个数,第一个为N (1 <= N <= 100) ,钉子的个数,第二个为实数R,钉子的半径。所有的钉子都具有相同的半径。接下来的N行,每一行为一对实数,用空格隔开,描述钉子的中心坐标。坐标的绝对值不超过100。是从任一个钉子开始,按照顺时针方向描钉子的坐标的。不同的钉子不会相连。
输出
The standard output should contain in its only line a real number with two digits precision (after a decimal point) ― a length of the rope.
输出绳子的长度,精确到小数点后2位。
输出绳子的长度,精确到小数点后2位。
样例输入 复制
4 1
0.0 0.0
2.0 0.0
2.0 2.0
0.0 2.0
样例输出 复制
14.28