Universal Cup Judging System

Universal Cup

时间限制: 10 s 内存限制: 256 MB 总分: 100
统计

考虑二维平面上的 $n$ 个点 $p_1, \dots, p_n$。考虑 $n$ 个圆 $C_1, C_2, \dots, C_n$,其中第 $i$ 个圆的圆心为 $p_i$,所有圆的半径均为 $R$。

确定最小的 $R$ 值,使得可以画出另一个广义圆 $\Gamma$ 与所有 $n$ 个圆相交。请同时找到这样一个 $\Gamma$。

  • 一个半径为 $r$ 的圆 $C$ 包含所有满足其到圆心的欧几里得距离恰好为 $r$ 的点。
  • 广义圆是指圆或直线。
  • 如果两个对象 $A$ 和 $B$ 共享一个公共点,则称它们相交。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 3000$)。接下来的 $n$ 行,每行包含两个整数 $x_i$ 和 $y_i$,表示点 $p_i$ 的坐标 ($0 \le x_i, y_i \le 10^5$)。保证给定的点中没有两个点重合。

输出格式

第一行输出最优解 $R_{opt}$。 你的输出应满足 $0 \le R_{opt} \le 10^5$。 可以证明最小值的存在性且其在该范围内。 假设当 $R = R_{opt}$ 时,$\Gamma_{opt}$ 与所有 $C_1, \dots, C_n$ 相交。 可以证明,在本问题的约束下,$\Gamma_{opt}$ 可以选择为圆心坐标为有理数的圆,或系数为整数的直线。

  • 在圆的情况下,输出 “C $X$ $Y$ $Z$ $r$”,表示半径为 $r$,圆心为 $O = (X/Z, Y/Z)$。 $X, Y, Z$ 必须是绝对值不超过 $10^{18}$ 的整数。$r$ 应为不超过 $10^{18}$ 的非负实数。
  • 在直线的情况下,输出 “L $a$ $b$ $c$”,表示直线 $L$ 满足方程 $ax + by = c$。 $a, b, c$ 必须是绝对值不超过 $10^{18}$ 的整数。

在检查你的答案时,评测系统将首先检查 $\Gamma_{opt}$ 是否与每个 $C_i$ 相交。判断标准如下:

  • 如果是圆的情况,检查 $|R - r| - \varepsilon \le d(O, p_i) \le R + r + \varepsilon$(其中 $d(O, p_i)$ 是 $p_i$ 与 $O$ 之间的欧几里得距离),
  • 或者如果是直线的情况,检查 $R \le d(L, p_i) + \varepsilon$(其中 $d(L, p_i)$ 是点 $p_i$ 到直线 $L$ 的距离)。

此处 $\varepsilon = 10^{-6}$。 之后,如果你的 $R_{opt}$ 与评测系统的 $R_{opt}$ 之间的绝对误差或相对误差不超过 $10^{-6}$,则你的答案被视为正确。

样例

输入 1

4
2 1
1 3
2 4
7 2

输出 1

0.27069063257455492223
C 1152 720 288 2.77069063257455492234

输入 2

7
26919 7739
85584 91359
47712 21058
13729 26355
16636 96528
88747 93023
46770 1150

输出 2

9663.87959749101919015857
C 3605577680770432 5873755742321056 96368792608 50864.33205303458045065668

输入 3

10
756 624
252 208
504 416
378 312
203 287
329 391
0 0
707 703
126 104
581 599

输出 3

46.05915288207108030175
L -1248 1512 90300

说明

前两个样例:

注意溢出问题。考虑使用 long double__int128

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.