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

18306번 - Hiding Nuts 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB49372974.359%

문제

Bob, a squirrel, has set up N hiding places throughout his territory, where he stores nuts before the winter. The hiding places are placed at integer coordinates on a grid. He would like to select one of those hiding places as his main den. He is very worried about his nuts being eaten by other animals. He would therefore like to choose a den that minimizes the average distance of the paths between the den and the N − 1 remaining hiding places.

Bob has kind of a poor sense of direction. In order not to get lost between his den and each hiding place, he decides that he will only travel using the horizontal and vertical lines of the grid at integer coordinates.

For instance, the distance between the points D and E in the following grid is 4 (one path of minimal length between D and E is drawn in red below), and the average distance between D and the other points is 13/5 .

입력

The input consists of the following lines:

  • on the first line: the total number N of hiding places, an integer;
  • on the next N lines: Xi and Yi, the integer coordinates of the i-th hiding place, separated by a space.

출력

The coordinates of a hiding place that minimizes the distance to the other hiding places. In case of equality, that hiding place must be the one with the smallest X coordinate and, in case there is still equality, with the smallest Y coordinate.

제한

  • 1 ≤ N ≤ 1 000;
  • 0 ≤ Xi, Yi ≤ 1 000 000 for all points.

No two hiding places are at the same coordinates.

예제 입력 1

6
2 3
4 3
1 1
3 1
0 0
3 2

예제 출력 1

3 1

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2019 연습 세션 PB번

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

출처

대학교 대회

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

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