Anti-AK Problem

TimeLimit:20000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
Special Judge
未提交 | 登录后收藏
Problem Description
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.
Input
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$.
Output
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}$.
SampleInput
1
2 1 0.1
0 0 1 1.5
0 1 0 1.4
SampleOutput
8.65419601623420079589
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: