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

31601번 - Symmetric Boundary 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
12 초 1024 MB36201356.522%

문제

Symmetrical figures are beautiful—and they are the subject of this task. A region in a 2D plane is convex if, for every pair of points $p$ and $q$ in the region, the segment connecting $p$ and $q$ is entirely included in the region. Also, a region in a 2D plane is point-symmetric if, when you rotate the region by 180ドル$ degrees around a certain point, the rotated region exactly matches the original region.

You are given a convex polygon in a 2D plane with $n$ vertices, numbered from 1ドル$ to $n$ in counterclockwise order. Vertex $i$ has coordinates $(x_i , y_i)$. No three vertices are collinear. Determine whether there exists a convex, pointsymmetric region containing all of the $n$ vertices on its boundary. If one or more such regions exist, compute the minimum area among all of them.

입력

The first line of input contains one integer $n$ (3ドル ≤ n ≤ 30$). Each of the next $n$ lines contains two integers. The $i$-th line contains $x_i$ and $y_i$ (0ドル ≤ x_i , y_i ≤ 1000$).

It is guaranteed that the given polygon is convex, its vertices are given in counterclockwise order, and no three of its vertices are collinear.

출력

If one or more such regions exist, output the minimum area among all of them. The relative error of the output must be within 10ドル^{-9}$.

If such a region does not exist, output -1 instead.

제한

예제 입력 1

4
0 0
10 0
8 9
4 9

예제 출력 1

90.0

예제 입력 2

8
8 10
2 9
0 8
0 2
2 0
8 0
10 2
10 8

예제 출력 2

-1

예제 입력 3

6
231 77
359 20
829 124
998 461
941 735
879 825

예제 출력 3

486567.9669655848

노트

Figure I.1 illustrates the vertices in the sample input as black dots. For sample inputs #1 and #3, the shaded regions represent the regions with the minimum possible area.

Figure I.1: Illustrations of the sample inputs (from left to right).

출처

ICPC > Regionals > Asia Pacific > Asia Pacific Championship > The 2024 ICPC Asia Pacific Championship I번

ICPC > Regionals > Asia Pacific > Asia Pacific Championship > The 2025 ICPC Asia Pacific Championship 연습 세션 B번

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

출처

대학교 대회

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

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