Keychain

시간 제한10초메모리 제한2048 MB

요약
주어진 점을 중심으로 하는 반지름 R인 원 모두와 만나는 직선 또는 원이 존재하는 최소 R을 구하고 그 도형을 출력한다.
난이도

어려움10점 중 9점

유형
기하, 이분 탐색, 수학
정답자
아직 제출이 없습니다

문제

Consider a two-dimensional plane and nn points p_1,…,p_np\_1, \ldots, p\_n on it. Consider nn circles C_1,C_2,…,C_nC\_1, C\_2, \ldots, C\_n: the ii-th circle is centered at p_ip\_i. All the radii of the nn circles are RR.

Determine the minimum value of RR such that one can draw another generalized circle Γ\Gamma that intersects all the nn circles. Please find one such Γ\Gamma as well.

  • A circle CC with radius rr contains all points such that the Euclidean distance between the point and the center of the circle is exactly rr.
  • A generalized circle is either a circle or a straight line.
  • We say two objects AA and BB intersect if they share a common point.

입력

The first line contains an integer nn (1≤n≤30001 \le n \le 3000). On each of the next nn lines, there will be two integers x_ix\_i and y_iy\_i indicating the coordinates of point p_ip\_i (0≤x_i,y_i≤1050 \leq x\_i, y\_i \leq 10^5). It is guaranteed that no two given points coincide.

출력

On the first line, print the optimal answer R_optR\_{\mathit{opt}}.

Your output should satisfy 0≤R_opt≤1050 \leq R\_{\mathit{opt}} \leq 10^5.

It can be proved that the minimum value exists and is in this range.

Suppose that Γ_opt\Gamma\_{\mathit{opt}} intersects all C_1,…,C_nC\_1,\ldots,C\_n when R=R_optR = R\_{opt}.

It can be shown that, under the constraints in this problem, Γ_opt\Gamma\_{opt} can be chosen to be either a circle centered at a rational coordinate, or a straight line with integer coefficients.

  • In the circle case, print "C XX YY ZZ rr", which means that the radius is rr, and the center of the circle is O=(X/Z,Y/Z)O = (X/Z, Y/Z). The values XX, YY, ZZ must be integers with absolute value not greater than 101810^{18}. The value rr should be a non-negative real number not greater than 101810^{18}.
  • In the straight line case, print "L aa bb cc", which means that the line LL satisfies the equation ax+by=cax + by = c. The values aa, bb, cc must be integers with absolute value not greater than 101810^{18}.

When checking your answer, the jury will first check whether Γ_opt\Gamma\_{opt} intersects each of the CC's. This will be judged by checking:

  • if ∣R−r∣−ε≤d(O,p_i)≤R+r+ε|R-r|-\varepsilon \leq d(O, p\_i) \leq R+r+\varepsilon in the circle case (d(O,p_i)d(O, p\_i) is the Euclidean distance between p_ip\_i and OO),
  • or R≤d(L,p_i)+εR \leq d(L, p\_i) + \varepsilon in the line case (d(L,p_i)d(L, p\_i) is the distance from point p_ip\_i to line LL).

Here, ε=10−6\varepsilon = 10^{-6}.

After that, your answer will be considered correct if the absolute or relative error between your R_optR\_{opt} and jury's R_optR\_{opt} doesn't exceed 10−610^{-6}.

힌트

The first two examples:

Be careful of overflow. Consider using long double or __int128.

예제3

  1. 예제 1

    입력
    4
    2 1
    1 3
    2 4
    7 2
    
    예상 출력
    0.27069063257455492223
    C 1152 720 288 2.77069063257455492234
    
  2. 예제 2

    입력
    7
    26919 7739
    85584 91359
    47712 21058
    13729 26355
    16636 96528
    88747 93023
    46770 1150
    
    예상 출력
    9663.87959749101919015857
    C 3605577680770432 5873755742321056 96368792608 50864.33205303458045065668
    
  3. 예제 3

    입력
    10
    756 624
    252 208
    504 416
    378 312
    203 287
    329 391
    0 0
    707 703
    126 104
    581 599
    
    예상 출력
    46.05915288207108030175
    L -1248 1512 90300