QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 32 MB 満点: 100

#17051. 异或

統計

Mirko 和 Slavko 制作了他们自己的 LED 显示屏。显示屏最初是全白的。在测试阶段的 $N$ 个步骤中,Mirko 每次都会在显示屏上连接三个电极,使它们形成一个等腰直角三角形。他注意到,连接电极后,该三角形区域内的所有像素都会被翻转(白色像素变黑,黑色像素变白)。

看着 Mirko 摆弄电极,Slavko 观察到屏幕上出现了有趣的图案。由于他具有数学天赋,他脑海中浮现的第一件事就是如何计算被黑色像素覆盖的总面积。请编写一个程序来帮他完成这个任务!

输入格式

输入的第一行包含一个整数 $N$ ($1 \le N \le 10$),表示 Mirko 摆弄电极所形成的三角形个数。

接下来的 $N$ 行,每行包含三个整数 $X, Y$ 和 $R$ ($1 \le X, Y, R \le 10^6$),描述一个三角形。$(X, Y)$ 是三角形左下角的坐标,而 $R$ 表示三角形两条直角边的长度。

输出格式

输出的第一行也是唯一的一行,应该包含被黑色像素覆盖的面积,保留一位小数。

样例

输入 1

3
1 1 2
7 1 6
5 3 4

输出 1

24.0

输入 2

5
5 5 99
5 5 99
5 5 99
5 5 99
5 5 99

输出 2

4900.5

输入 3

4
5 5 99
5 5 99
5 5 99
5 5 99

输出 3

0.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.