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

9583번 - Easy Geometry 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB80211218.750%

문제

Eva studies geometry. The current topic is about convex polygons, but Eva prefers rectangles. Eva’s workbook contains drawings of several convex polygons and she is curious what is the area of the maximum rectangle that fits inside each of them.

Help Eva! Given the convex polygon, find the rectangle of the maximum possible area that fits inside this polygon. Sides of the rectangle must be parallel to the coordinate axes.

입력

The first line contains a single integer n — the number of sides of the polygon (3 ≤ n ≤ 100 000). The following n lines contain Cartesian coordinates of the polygon’s vertices — two integers xi and yi (-109 ≤ xi, yi ≤ 109) per line. Vertices are given in the clockwise order.

The polygon is convex.

출력

Output four real numbers xmin, ymin, xmax and ymax — the coordinates of two rectangle’s corners (xmin < xmax, ymin < ymax). The rectangle must fit into the polygon and have the maximum possible area.

The absolute precision of the coordinates should be at least 10-5.

The absolute or relative precision of the rectangle area should be at least 10-5. That is, if A' is the actual maximum possible area, the following must hold: min(|A-A'|,|A−A'|/A') ) ≤ 10-5.

제한

예제 입력 1

4
5 1
2 4
3 7
7 3

예제 출력 1

3.5 2.5 5.5 4.5

예제 입력 2

5
1 1
1 4
4 7
7 4
7 1

예제 출력 2

1 1 7 4

힌트

출처

ICPC > Regionals > Northern Eurasia > Northern Eurasia Finals > NEERC 2013 E번

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

출처

대학교 대회

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

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