QOJ.ac

QOJ

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

#11248. 凸多面体

Statistics

Harold 住在北回归线上,他刚刚注意到太阳正处于头顶上方,这非常罕见!他非常兴奋,拿出了他的一个玩具——一个凸多面体,并开始玩耍。阳光照射在玩具上,在平坦的地面上投下了玩具的影子。Harold 发现,当他在三维空间中旋转这个玩具时,影子的面积可能会发生变化。他想知道这个影子的最大面积是多少。

更正式地说:给定一个凸多面体,求其投影到平面上的最大可能面积。根据维基百科的定义,凸多面体是一个具有平坦多边形面、直边和尖角(或顶点)的三维实体,其表面(包括面、边和顶点)不自交,且连接多面体内任意两点的线段都包含在多面体的内部或表面上。

输入格式

输入的第一行给出一个整数 $T$,表示测试用例的数量,随后是一个空行。

接下来是 $T$ 个测试用例。每个测试用例的第一行包含一个整数 $N$,表示凸多面体上的点数。接下来的 $N$ 行,每行包含 3 个实数 $X_i, Y_i$ 和 $Z_i$,表示凸多面体第 $i$ 个点在三维空间中的坐标。所有这些点各不相同。

输出格式

对于每个测试用例,输出一行 “Case #x: y”,其中 $x$ 是测试用例编号(从 1 开始),$y$ 是投影的最大面积。如果 $y$ 与正确答案的绝对误差或相对误差在 $10^{-6}$ 以内,则视为正确。

数据范围

  • $1 \le T \le 100$
  • $4 \le N \le 50$
  • 所有 $X_i, Y_i$ 和 $Z_i$ 均在 $[-10^9, 10^9]$ 范围内。
  • 保证这些点构成一个凸多面体。
  • 不存在一个包含所有点的平面。

样例

输入 1

1
4
0.0 0.0 0.0
0.0 0.0 1.0
0.0 1.0 0.0
1.0 0.0 0.0

输出 1

Case #1: 0.8660254038

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.