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

24601번 - Dorm Room Divide 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB4001108126.471%

문제

Bob and Alice are roommates at the International College of Polygonal Chambers (ICPC). To avoid conflict, they've agreed to divide their dorm room in half---as closely as possible. However, the room is shaped so irregularly that they need your help!

Each dorm room is a convex polygon, with a single entrance. You need to figure out how to divide this room in half (by area) using a single straight line starting at the door, and terminating on a wall or corner of the room.

입력

The first line of input contains a single integer $n$ (3ドル \leq n \leq 2 \cdot 10^5$), which is the number of vertices describing the convex polygon.

Each of the next $n$ lines contains two space-separated integers $x$ and $y$ ($-10^7 \le x,y \le 10^7$). These are the coordinates of the vertices of the convex polygon, in counterclockwise order. All points will be distinct.

The door is considered to be a single point located at the first vertex given in the input.

출력

Output two space-separated real numbers, which are the $x$ and $y$ coordinates of the other endpoint of the dividing line, such that the area of the room is divided in half. Each coordinate value must be accurate to within an absolute or relative error of 10ドル^{-6}$. Output $x$ first, then $y$.

Note that Sample 1 corresponds to the example in the problem description.

제한

예제 입력 1

5
7 1
8 3
5 5
2 3
3 1

예제 출력 1

3.5 4

예제 입력 2

3
2 2
10 3
6 8

예제 출력 2

8 5.5

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2021 ICPC Pacific Northwest Region > Division 1 L번

ICPC > Regionals > North America > Pacific Northwest Regional > 2021 ICPC Pacific Northwest Region > Division 2 Y번

ICPC > Regionals > North America > South Central USA Regional > 2021 South Central USA Regional Contest > Division 1 D번

ICPC > Regionals > North America > South Central USA Regional > 2021 South Central USA Regional Contest > Division 2 D번

ICPC > Regionals > North America > Mid-Central Regional > Mid-Central USA Programming Contest 2021 D번

ICPC > Regionals > North America > Northeast North America Regional > 2021 Northeast North America Regional Contest D번

ICPC > Regionals > North America > Southeast USA Regional > 2021 Southeast USA Regional Programming Contest > Division 1 D번

ICPC > Regionals > North America > Southeast USA Regional > 2021 Southeast USA Regional Programming Contest > Division 2 D번

  • 문제를 만든 사람: Rachel Krohn
(追記) (追記ここまで)

출처

대학교 대회

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

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