Logo
(追記) (追記ここまで)

16995번 - Piece of Cake 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB52413278.049%

문제

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

Alice will now choose exactly k random vertices (k≥3) 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 n and k (3 ≤ k ≤ n ≤ 2,500), where n is the number of vertices of the cake, and k is the number of vertices of the piece that Alice cuts.

Each of the next n lines will contain two space-separated real numbers x and y (−10.0 ≤ x, y ≤ 10.0), where (x, y) 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 10−6.

제한

예제 입력 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

힌트

출처

University > North American Invitational Programming Contest > NAIPC 2019 A번

Contest > Open Cup > 2018/2019 Season > Stage 14: Grand Prix of America A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /