QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 256 MB 總分: 100

#16968. 管道装箱

统计

联合管道制造公司(ACM)生产具有圆形横截面的金属管道,用于容纳许多不同类型的电线。电线的圆形横截面直径最大可达 20 毫米(20000 微米)。ACM 需要一个程序来计算能够容纳 4 根给定直径电线的管道的最小内径。

图 4 展示了将四根不同尺寸的电线装入最小直径管道的示例。

图 4:在管道内装入电线

你的程序必须读入电线的直径,并确定能够容纳这些电线的管道的最小内径。

输入格式

输入包含多个测试用例。每个测试用例由一行组成,包含四个整数 $d_1, d_2, d_3$ 和 $d_4$,表示电线的直径(单位:微米)。这些整数满足 $20000 \ge d_1 \ge d_2 \ge d_3 \ge d_4 > 0$。最后一个测试用例后面紧跟一行,包含一个整数零。

输出格式

对于每个测试用例,输出测试用例的编号(从 1 开始),然后是管道的最小直径(单位:微米),四舍五入到最近的整数。请遵循样例输出的格式。

样例

输入样例 1

10000 10000 10000 10000
10000 10000 10000 3000
12000 12000 3600 3600
0

输出样例 1

Case 1: 24142
Case 2: 21547
Case 3: 24000

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.