码迷,mamicode.com
首页 > 其他好文 > 详细

寒假集训.Rope

时间:2015-01-29 17:48:35      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:acm   c++   

F - Rope
Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

Plotters have barbarously 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.

Input

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 either in a clockwise or in a counterclockwise order starting from an arbitrary nail. Heads of different nails don’t overlap.

Output

Output a real number with two digits precision (after a decimal point) — a length of the rope.

Sample Input

input output
4 1
0.0 0.0
2.0 0.0
2.0 2.0
0.0 2.0
14.28

寒假集训.Rope

标签:acm   c++   

原文地址:http://blog.csdn.net/a576699534/article/details/43272339

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!