logo AlgoBeat OnlineJudge
登录 注册

#216178. [ICPC 2019 NAIPC] Piece of Cake

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Alice received a cake for her birthday! Her cake can be described by a convex polygon with vertices. No three vertices are collinear.

Alice will now choose exactly random vertices () from her cake and cut a piece, the shape of which is the convex polygon defined by those vertices. Compute the expected area of this piece of cake.

输入格式

Each test case will begin with a line with two space-separated integers and (), where is the number of vertices of the cake, and is the number of vertices of the piece that Alice cuts.

Each of the next lines will contain two space-separated real numbers and (), where is a vertex of the cake. The vertices will be listed in clockwise order. No three vertices will be collinear. All real numbers have at most 6 digits after the decimal point.

输出格式

Output a single real number, which is the expected area of the piece of cake that Alice cuts out. Your answer will be accepted if it is within an absolute error of .

样例

样例输入 1

4 3
0 0
1 1
2 1
1 0

样例输出 1

0.50000000

样例输入 2

5 5
0 4
4 2
4 1
3 -1
-2 4

样例输出 2

12.50000000

样例输入 3

5 3
-1.20 2.80
3.30 2.40
3.10 -0.80
2.00 -4.60
-4.40 -0.50

样例输出 3

12.43300000