QOJ.ac

QOJ

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

#9653. 装箱问题

统计

将物品装入箱子是一个众所周知的装箱问题,Fish 也在研究它。作为一个初学者,他从二维版本的两个矩形物品问题开始。他只想找到一个面积最小的凸多边形,使得这两个物品都能被包含在其中。请注意,这两个物品不能重叠,你可以根据需要在这个平面上平移或旋转它们。

请帮助 Fish 解决这个问题。

输入格式

输入的第一行包含一个整数 $T$,表示测试用例的数量。接下来有 $T$ 行,每行代表一个测试用例。

对于每个测试用例,包含四个由空格分隔的整数 $w_1, h_1, w_2, h_2$,分别表示这两个物品的宽和长。

输出格式

对于每个测试用例,输出一行 Case x: y,其中 $x$ 表示从 1 开始的测试用例编号,$y$ 表示最小面积。

如果你的答案与标准答案的绝对误差不超过 $10^{-6}$,则视为正确。

样例

样例输入 1

2
1 3 2 4
2 3 4 5

样例输出 1

Case 1: 11.5
Case 2: 27.0

说明

$1 \le T \le 100$ $1 \le w_1, h_1, w_2, h_2 \le 100$

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.