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

32901번 - Mouse Trap 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 (추가 시간 없음) 2048 MB48373380.488%

문제

Medea the cat is a real troublemaker. Even though she is loving and caring with humans, sometimes she likes to crash on mouse parties in the field nearby her house, uninvited, just for the fun of it!

A mouse party is a bunch of mice standing on the vertices of a convex polygon in the two-dimensional plane. When Medea crashes a mouse party, she jumps, out of nowhere, to some point inside the party's polygon. All the mice and Medea can be considered as points in the two-dimensional plane, meaning that they have no shape or dimensions.

Medea is still careful, however. She considers how the mice might encircle her, so that she runs away before they get a chance to do so. Medea defines an encirclement as a subset of exactly three mice such that she lies strictly inside the triangle constructed with the mice as vertices. An example can be seen in Figure M.1.

Figure M.1: Illustration of Sample Input 2, showing one of the three encirclements in the case where Medea jumps to $(1.4, 1.4)$.

One day, Medea decided to crash on a party of mice. She does not jump accurately, so she does not know exactly which point inside the mouse party she is going to jump to -- all she knows is that she will jump to a uniformly random point with real coordinates inside the mouse party.

Medea wants to know the expected number of distinct encirclements after she lands inside the party. This turned out to be too difficult to calculate, even for Medea's 200 IQ points, so she asked for your help!

입력

The input consists of:

  • One line with an integer $n$ (3ドル \leq n \leq 2\cdot 10^5$), the number of mice.
  • $n$ lines, each with two integers $x$ and $y$ ($|x|, |y| \leq 10^7$), the coordinates of a mouse.

The coordinates of the mice are given in counterclockwise order and form a strictly convex polygon with non-zero area. A strictly convex polygon is a convex polygon such that no three consecutive vertices are on a straight line.

출력

Output the expected number of encirclements after Medea lands inside the polygon.

Your answer should have an absolute or relative error of at most 10ドル^{-4}$.

제한

예제 입력 1

4
0 0
1 0
1 1
0 1

예제 출력 1

2.0

예제 입력 2

5
0 0
1 0
2 1
1 2
0 2

예제 출력 2

3.66666667

예제 입력 3

3
-3141592 -2718281
-3141593 -2718281
-3141592 -2718282

예제 출력 3

1.0

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2024 M번

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

출처

대학교 대회

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

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