QOJ.ac

QOJ

حد الوقت: 2.5 s حد الذاكرة: 256 MB مجموع النقاط: 100

#11247. 圆顶与石碑

الإحصائيات

考古学家最近发现了一座由古代文明建造的圆顶建筑。其内表面是一个完美的半球体,圆顶下存放着许多石碑。这些石碑是长方体,且厚度相同。它们垂直放置在平坦的地面上,并彼此平行,如下图所示。请注意,假设你的视线与石碑平行(从图的右下方观察),则不允许任何石碑遮挡其他石碑的任何部分。

在获取更多信息之前,战争爆发了,圆顶被完全摧毁,石碑散落在各处。然而,所有石碑在某种程度上都保持完好,并在战后被考古学家收集起来。现在,考古学家计划重建圆顶,他们想知道其内表面的最小半径。

输入格式

输入的第一行包含测试用例的数量 $T$。接下来是 $T$ 个测试用例。 每个测试用例以一个数字 $N$ 开头,表示石碑的数量。接下来的 $N$ 行,每行包含两个浮点数 $a_i$ 和 $b_i$(保留 4 位小数),代表石碑 $i$ 除了厚度之外的两个维度。所有石碑的厚度相同,均为 $1$。注意,由于原始放置位置已丢失,石碑及其维度不按任何特定顺序排列。

输出格式

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

数据范围

  • $1 \le T \le 100$
  • $1 \le N \le 10^5$
  • $1 \le a_i, b_i \le 10^5$

样例

输入 1

2
9
2.0000 2.0000
3.0000 4.0000
3.0000 6.0000
4.0000 5.0000
4.0000 6.0000
4.2500 4.2500
3.8800 3.8800
3.2200 3.2200
2.0000 2.0000
3
2.0000 4.0000
2.0000 2.0000
4.0000 2.0000

输出 1

Case #1: 5.0249378189
Case #2: 3.0000000000

说明

第一个测试用例在上面的图片中展示,从左下角到右上角。 对于第二个测试用例,请注意石碑在战争期间散落,因此它们的原始放置位置已丢失。考古学家只想知道最小的内半径。

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.