QOJ.ac

QOJ

时间限制: 30.0 s 内存限制: 256 MB 总分: 100

#17510. 每个人都可能在太空中迷失

统计

众所周知,航天飞机的所有关键系统都进行了“冗余备份”以防万一。在寒冷而空旷的太空中,成功导航的关键问题是那个古老的问题:“我们在哪里?”幸运的是,根据上述规则,航天飞机的坐标可以从三个独立的来源获取。这些系统不仅提供了 $x$、$y$ 和 $z$ 坐标,还提供了观测误差的上限 $b$。该误差适用于与点 $(x, y, z)$ 的距离,这意味着当系统报告 $(x, y, z)$ 时,航天飞机的真实坐标可能是任何满足 $\sqrt{(x - x')^2 + (y - y')^2 + (z - z')^2} \le b$ 的 $(x', y', z')$。说实话,在给出多达三个测量值的情况下,确定航天飞机的具体位置并不容易。你的任务是确定航天飞机可能存在的(子)空间体积。已知这三个系统中至少有一个是完好无损的,但其他系统有可能是损坏的。

输入格式

输入包含多组测试数据。第一行包含一个正整数 $Z \le 10000$,表示测试数据的组数。

随后是 $Z$ 组测试数据。每组测试数据包含三行,每行代表一次独立的测量。每次测量包含坐标 $x, y, z \in [-10^9, 10^9]$ 以及观测误差 $b \in [1, 10^9]$,它们之间用单个空格分隔。

输出格式

对于每组测试数据,输出一行,表示航天飞机可能存在的(子)空间体积。当且仅当你的输出与标准答案的相对或绝对误差不超过 $10^{-6}$ 时,该结果才会被判定为正确。

样例

输入样例 1

2
0 0 0 10
19 0 0 10
23 0 0 10
0 0 0 10
12 0 0 10
18 0 0 10

输出样例 1

9602.0161463094
9334.7189713665

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.