QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 100

#3922. 构建边界

Statistiques

Maarja 想要购买一块矩形土地,并在上面建造三座建筑物。 这些建筑物在地面上的边界必须是矩形,尺寸分别为 $a_1 \times b_1$、$a_2 \times b_2$ 和 $a_3 \times b_3$。它们可以相互接触,但不能重叠。只要保持边与水平和垂直方向平行,它们也可以旋转。 Maarja 需要购买的土地的最小面积是多少?

图 B.1:样例输入 1 中两个测试场景及其解法的示意图。在第二个场景中,5 × 1 的建筑物被旋转了 90 度。

输入格式

输入包含多个测试场景。第一行包含一个整数 $t$ ($1 \le t \le 1000$),表示场景的数量。接下来是 $t$ 个场景。每个场景由单行组成,包含六个整数 $a_1, b_1, a_2, b_2, a_3$ 和 $b_3$ ($1 \le a_1, b_1, a_2, b_2, a_3, b_3 \le 10^9$)。

输出格式

对于每个测试场景,输出 Maarja 能够建造这三座建筑物所需的最小土地面积。

样例

输入 1

2
2 3 2 2 1 1
2 4 5 1 2 3

输出 1

12
21

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.