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

30315번 - King's Keep 스페셜 저지다국어

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

문제

King Carl's kingdom contains $k$ keeps (commonly called castles).

Coordinates of keeps are known, and King Carl considers himself convinced that it could be convenient to choose a central keep as King Carl's residence.

Critically, King Carl considers that the average cost to carry commands from King Carl's residence to King Carl's other keeps should be small.

Compute the minimal average Euclidean distance1 from his residence keep to the other keeps if King Carl chooses his residence optimally.


1The Euclidean distance between two points is the length of a straight line segment between these points.

입력

The input consists of:

  • One line with an integer $k$ (2ドル\leq k\leq 1000$), the number of keeps.
  • $k$ lines, each with two integers $x$ and $y$ ($|x|, |y| \leq 1000$), the coordinates of the keeps.

It is guaranteed that all keeps are at distinct locations.

출력

Output the minimal possible average distance from the keep that is chosen as the king's residence to all other keeps.

Your answer should have an absolute or relative error of at most 10ドル^{-6}$.

제한

예제 입력 1

3
0 0
9 9
0 9

예제 출력 1

9

예제 입력 2

5
-3 5
6 8
1 2
5 -4
-7 -9

예제 출력 2

8.405705684

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2023 Preliminaries K번

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

출처

대학교 대회

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

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