QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100

#13140. 镇纸

Statistics

贵公司生产艺术镇纸。每个镇纸都是由两个共用一个面的四面体组成的并集。它们是带有嵌入式彩色斑点的透明固体玻璃。每个镇纸中的一个小斑点实际上是一个微小的 RFID 芯片。该芯片必须放置在靠近配套计算机的位置,以便计算机能够运行。通常,这是通过将镇纸放在计算机顶部来实现的。然而,芯片的范围有限,因此它与平坦计算机顶部的距离非常重要。因此,计算当镇纸处于足够稳定的位置时,芯片到计算机顶部的最小和最大可能距离非常重要。如果将镇纸的质心在任何方向上移动最多 $0.2$ 个单位,镇纸都不会移动,则认为该位置足够稳定。您可以假设镇纸具有均匀的密度,并且芯片足够小,可以被视为一个点。

图 10

图 11

举个例子,考虑一个镇纸,其公共面的顶点为 $A = (0, 0, 0)$,$B = (9, 0, 0)$,$C = (0, 8, 0)$,其中一个四面体的第四个顶点为 $D = (0, 0, 9)$,另一个四面体的第四个顶点为 $E = (1, 1, -8)$,芯片位于 $F = (1, 2, -1)$。(参见图 10,其中芯片显示为红点。)将镇纸以面 $BCD$ 放置在计算机上,得到的最大距离约为 $3.7$(图 11 的上部)。将镇纸以面 $ACD$ 放置在计算机上,得到的最小距离为 $1.0$(图 11 的下部)。将镇纸以面 $ACE$ 放置在计算机上,得到的距离仅为 $0.9$,但不够稳定。

输入格式

输入包含一个或多个测试用例。每个测试用例是一行,依次描述六个点 $A, B, C, D, E$ 和 $F$。每个点由三个整数 $x, y$ 和 $z$ 给出其坐标。两个四面体的体积均为正,$D$ 和 $E$ 位于由点 $A, B, C$ 定义的平面的两侧,且点 $F$ 严格位于镇纸内部。每个坐标的绝对值不超过 $1000$。镇纸总是至少可以放置在一个足够稳定的位置。

输入以仅包含整数 $0$ 的一行结束。

输出格式

对于每个测试用例,显示案例编号,后跟镇纸在足够稳定时芯片到基准平面的最小和最大距离。这些数字应四舍五入并显示到小数点后五位。请遵循样例输出的格式。

样例

样例输入 1

0 0 0 9 0 0 0 8 0 0 0 9 1 1 -8 1 2 -1
0 0 0 7 0 0 0 7 0 0 0 7 -1 -2 -3 2 2 2 
1 2 3 6 2 3 -2 6 3 -1 0 7 4 1 -2 -1 5 3 
0

样例输出 1

Case 1: 1.00000 3.73526 
Case 2: 0.57735 2.66967 
Case 3: 0.28214 5.00871

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.