当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6802:Anti-AK Problem

Special Judge 特殊评判
题目描述
Zhang3 and Aunt are playing with tomatoes. They throw tomatoes onto a sphere. The center of the sphere is at $(0, 0, 0)$, and the radius is $R$. Each time a tomato is thrown, it will burst on the surface of the sphere, then the tomato juice will cover a certain circle on the surface of the sphere, which is called a spherical circle for short. A spherical circle can be represented as $(x, y, z, r)$, where $(x, y, z)$ is the center, a point on the surface, and $r$ is the radius, which is the spherical distance between center and border of the circle. Those points on the surface whose spherical distance to center $(x, y, z)$ is not greater than $r$ are in the circle. (As you know, the spherical distance between two points on the surface is the shortest distance to travel from one to another, passing through only points on the surface of the sphere.)

Zhang3 has already thrown $n$ tomatoes, the $i^\mathrm{th}$ of which covered a spherical circle $(x_i, y_i, z_i, r_i)$ with tomato juice.

Aunt decides to throw an extra tomato. She will randomly choose a point on the surface of the sphere, called $(x, y, z)$, and then let tomato juice cover a spherical circle $(x, y, z, r_0)$, where $r_0$ is given.

Zhang3 wants to know the expected area which is covered by tomato juice at least once. Please calculate and print the value.
输入解释
The first line of the input gives the number of test cases, $T \; (1 \le T \le 10)$. $T$ test cases follow.

For each test case, the first line contains three numbers $n, R, r_0 \; (1 \le n \le 5000, 1 \le R \le 10)$, representing the number of tomatoes thrown by Zhang3, the radius of the sphere, and the radius of the random spherical circle, respectively.

Then $n$ lines follow, the $i^\mathrm{th}$ of which contains four real numbers $x_i, y_i, z_i, r_i$, representing the $i^\mathrm{th}$ spherical circle.

The sum of $n$ in all test cases doesn't exceed $10000$.

For every real number in the input, the decimal part is not longer than 25 digits. The center of each spherical circle, i.e. $(x_i, y_i, z_i)$, has a distance of at most $10^{-20}$ to the surface of the sphere. Formally, $|(x_i, y_i, z_i)| \in [R - 10^{-20}, R + 10^{-20}]$.

No spherical circle can be as large as half the sphere. Formally, $0.001 \pi R \le r_0, r_i \le 0.499 \pi R$.
输出解释
For each test case, print a line with a real number, representing the answer.

Your answers should have absolute or relative errors of at most $10^{-9}$.
输入样例
1
2 1 0.1
0 0 1 1.5
0 1 0 1.4
输出样例
8.65419601623420079589
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6802

最后修改于 2020-10-25T23:34:31+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
40000/20000MS(Java/Others) 524288/524288K(Java/Others)