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

22598번 - Approximate Circle 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB98361532.609%

문제

Consider a set of $n$ points ($x_{1},ドル $y_{1}$), ..., ($x_{n},ドル$y_{n}$) on a Cartesian space. Your task is to write a program for regression to a circle $x^2 + y^2 + ax + by + c = 0$. In other words, your program should find a circle that minimizes the error. Here the error is measured by the sum over square distances between each point and the circle, which is given by:

$$\sum_{i=1}^{n}{(x_i^2 + y_i^2 + ax_i + by_i + c) ^2}$$

입력

The input begins with a line containing one integer $n$ (3 ≤ $n$ ≤ 40,000). Then $n$ lines follow. The $i$-th line contains two integers $x_{i}$ and $y_{i}$ (0 ≤ $x_{i},ドル $y_{i}$ ≤ 1,000), which denote the coordinates of the $i$-th point.

You can assume there are no cases in which all the points lie on a straight line.

출력

Print three integers $a,ドル $b$ and $c,ドル separated by space, to show the regressed function. The output values should be printed with three digits after the decimal point, and should not contain an error greater than 0.001.

제한

예제 입력 1

4
0 0
100 0
100 100
0 100

예제 출력 1

-100.000 -100.000 0.000

예제 입력 2

3
0 0
10 0
5 100

예제 출력 2

-10.000 -99.750 0.000

힌트

출처

Contest > ICPC Japanese Alumni Group > JAG Winter Contest > JAG Winter Contest 2010 A번

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

출처

대학교 대회

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

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