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

15497번 - Cover 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 64 MB78494866.667%

문제

You are given N points in the coordinate system. They need to be covered with one or more rectangles, such that the following conditions are met:

  • The sides of each rectangle are parallel with the coordinate axes,
  • The center of each rectangle is in the origin, i.e. point (0, 0),
  • Each given point is located either inside of the rectangle or on its boundaries.

Of course, it is possible to cover all the points using only one rectangle, but this rectangle could have a very large surface area. Our goal is to find a selection of required rectangles such that the sum of their surface areas is minimal.

입력

The first line of input contains the integer N (1 ≤ N ≤ 5000), the number of points.

Each of the following N lines contains two integers X and Y (-50 000 000 ≤ X, Y ≤ 50 000 000, XY ≠ 0), the coordinates of each point.

출력

You must output the required minimal sum of surface areas of the rectangles.

제한

예제 입력 1

2
1 1
-1 -1

예제 출력 1

4

예제 입력 2

3
-7 19
9 -30
25 10

예제 출력 2

2080

예제 입력 3

6
1 20
3 17
5 15
8 12
9 11
10 10

예제 출력 3

760

힌트

Clarification of the first test case: ​We choose the rectangle whose opposite angles are the given points, since it meets the conditions from the task.

Clarification of the second test case: ​We choose two rectangles with their centers in the origin. The first is of dimensions 50 x 20 and covers point (25, 10). The second is of dimensions 18 x 60 and covers the first two points. If we wanted to cover all the points using one rectangle, it would be of dimensions 50 x 60.

출처

Contest > Croatian Open Competition in Informatics > COCI 2017/2018 > Contest #6 4번

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

출처

대학교 대회

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

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