QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 64 MB Puntuación total: 100

#6524. 最终防线

Estadísticas

平面上有一个圆,其圆心坐标和半径均未知。 Chiaki 在平面上找到了三个不同的点 $A$、$B$ 和 $C$,并且她还知道每个点到圆周的最短距离。 Chiaki 想要根据上述信息找到最小的圆。 注意,通常情况下,半径为无穷大的圆是一条直线。但在本题中,直线不被视为圆。

输入格式

输入包含多组测试数据。第一行包含一个整数 $T$ ($1 \le T \le 2 \times 10^5$),表示测试数据的组数。对于每组测试数据: 第一行包含三个整数 $x_a, y_a$ 和 $d_a$ ($-100 \le x_a \le 100, y_a = 0, 1 \le d_a \le 100$),表示点 $A$ 的坐标以及到圆周的最短距离。 第二行包含三个整数 $x_b, y_b$ 和 $d_b$ ($-100 \le x_b \le 100, y_b = 0, 1 \le d_b \le 100$),表示点 $B$ 的坐标以及到圆周的最短距离。 第三行包含三个整数 $x_c, y_c$ 和 $d_c$ ($-100 \le x_c, y_c, d_c \le 100, d_c \neq 0$),表示点 $C$ 的坐标以及到圆周的最短距离。

如果距离等于 $0$,则该点在圆周上。如果距离大于 $0$,则该点在圆内。如果距离小于 $0$,则该点在圆外,且最短距离为该值的绝对值。 保证最小可能圆的半径最大为 $10^4$。

输出格式

对于每组测试数据,如果存在无穷多个可能的圆,输出 $-1$。如果不存在这样的圆,输出 $0$。否则,输出一个整数 $m$ 和一个实数 $r$,中间用空格隔开,分别表示可能的圆的数量和最小圆的半径。如果你的答案与标准答案的相对误差不超过 $10^{-6}$,则会被接受。

样例

输入 1

2
0 0 1
3 0 2
10 2 2
0 0 1
3 0 2
10 2 -2

输出 1

2 10.327329213474
2 5.341730785446

说明

下图展示了样例。

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.