QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100

#13619. 圆形

الإحصائيات

Snuke 有一个白色的平面。她会依次进行 $n$ 次操作。在第 $i$ 次操作中,她会把圆心在 $(x_i, y_i)$、半径为 $r_i$ 的圆涂成黑色。

Takahashi 想要知道,每一次操作结束后,平面上黑色部分的面积是多少。

输入格式

从标准输入读入数据。

第一行输入一个整数 $T$,表示子任务编号。

第二行输入一个整数 $n$。

接下来 $n$ 行,第 $i + 1$ 行输入三个整数 $x_i, y_i, r_i$。

输出格式

输出到标准输出。

输出 $n$ 行,第 $i$ 行输出一个实数,表示第 $i$ 次操作结束后,平面上黑色部分的面积。

你的答案被判定为正确,当且仅当你每一行输出的答案与参考答案之间的绝对或相对误差小于 $10^{-9}$。

样例一

input

1
2
0 0 1
1 0 2

output

3.1415926536
12.5663706144

explanation

第一个圆的圆心在 $(0, 0)$,半径为 $1$,它的面积是 $\pi$。

第二个圆的圆心在 $(1, 0)$,半径为 $2$。它完全包含了第一个圆,所以这两个圆的并的面积是 $4 \pi$。

样例二

input

2
6
-9 -6 3
9 -2 2
0 -1 2
0 -1 2
10 -6 6
-3 -7 7

output

28.2743338823
40.8407044967
53.4070751110
53.4070751110
154.0763284686
282.6344779456

样例三

input

3
6
2 10 1
1 10 1
2 10 1
2 9 1
4 8 1
4 8 1

output

3.1415926536
5.0548156086
5.0548156086
6.8402137720
9.9818064256
9.9818064256

限制及约定

对于所有数据,保证:

  • $1 \le n \le 2000$
  • $-10^4 < x_i, y_i < 10^4$
  • $0 < r_i < 10^4$

测试点编号$n \le$特殊性质分数依赖的子任务
1$2$18
2$30$151
3$200$$r_i = 1$13
4251, 2, 3
5$2000
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.