8535: Falfa with Polygon

内存限制:512 MB 时间限制:3 S
题面:传统 评测方式:文本比较 上传者:
提交:2 通过:1

题目描述

Falfa is studying computational geometry recently, and she came up with an interesting idea:Give a r-point-convex on the Catesian plane and a constant k. You can choose any k points from the given points and these points will compose asub-convex of the given convex.Falfa wants to find the k-point-subconvex with maximum perimeter.Can you help her find it?

输入格式

 The first line contains 2 integers n and k(3<k<n <2000),as the legend.The i-th of the next n lines contains two integers a; and g (-10'< ey,9<10'),representing the coordirof the i-th point of the convex.It is guaranteed that the points of the convex will be given in clockwise or counterclockwise order.

输出格式

output a real number representing the answer.Your answer is considered correct if its absolute or relative ercor does not exceed 10-6

输入样例 复制

4 3
1.00 1.00
1.00 -1.00
-1.00 -1.00
-1.00 1.00

输出样例 复制

6.828427125

数据范围与提示

因为没有special judge ,答案要保留9位小数即可;printf("%.9lf\n",ans);

分类标签