QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 256 MB 満点: 100 ハック可能 ✓

#9721. 捉迷藏

統計

小兔子和小马正在平面上玩捉迷藏,该平面可以用笛卡尔坐标系描述。小马是躲藏者,小兔子是寻找者。小兔子急于获胜,所以他决定作弊。他准备了三个定位装置,分别放置在 $(0, 0)$、小马所在位置以及他自己所在位置。这些装置无法显示精确坐标,但可以显示任意两个装置之间的曼哈顿距离。

曼哈顿距离是线段在坐标轴上的投影长度之和。例如,$(x_1, y_1)$ 和 $(x_2, y_2)$ 之间的曼哈顿距离为 $|x_1 - x_2| + |y_1 - y_2|$。也就是说,如果小兔子在 $(x_1, y_1)$,小马在 $(x_2, y_2)$,那么小兔子的装置将显示 $d_{01} = |x_1| + |y_1|$,$d_{02} = |x_2| + |y_2|$ 以及 $d_{12} = |x_1 - x_2| + |y_1 - y_2|$。

得到这些数据后,小兔子更容易找到小马了。但小兔子想知道,如果他们的坐标都是整数,那么他们所在位置有多少种不同的情况。请注意,当 $(x_1, y_1) \neq (x_2, y_2)$ 时,小兔子在 $(x_1, y_1)$ 且小马在 $(x_2, y_2)$ 的情况,与小兔子在 $(x_2, y_2)$ 且小马在 $(x_1, y_1)$ 的情况是不同的。小兔子和小马也可能在同一个点。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 10^5$),表示测试用例的数量。

每个测试用例包含三个整数 $d_{01}, d_{02}, d_{12}$ ($0 \le d_{01}, d_{02}, d_{12} \le 10^9$),其含义如上所述。

输出格式

对于第 $x$ 个测试用例,如果答案为 $y$,请在单行中输出 Case #x: y

样例

输入 1

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

输出 1

Case #1: 32
Case #2: 20
Case #3: 48
Case #4: 0

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.