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

建议使用的浏览器:

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

7063:Square Card

题目描述
Eric is playing a game on an infinite plane.

On the plane, there is a circular area with radius $r_1$ called $\textbf{the Scoring Area}$. Every time Eric will throw a square card with side length $a$ into the plane, then the card will start rotating around its centre. If at one moment the card is strictly inside $\textbf{the Scoring Area}$, the current play will be scored.

There is another circular area with radius $r_2$ called $\textbf{the Bonus Area}$. If the play is scored in the current situation, the square card will continue rotating and if at one moment it is strictly inside $\textbf{the Bonus Area}$, he will get an extra bonus.

Eric isn't good at this game, so we can briefly consider that he will throw the card to any postion with an equal probability.

Now Eric wants to know what the ratio of the possibility of being scored and getting the bonus simultaneously to the possibility of being scored is.

The coordinates of the centre of $\textbf{the Scoring Area}$ are $(x_1,y_1)$.
The coordinates of the centre of $\textbf{the Bonus Area}$ are $(x_2,y_2)$.
输入解释
The first line contains a number $T$($ 1 \leq T \leq 20$), the number of testcases.

For each testcase, there are three lines.
In the first line there are three integers $r_1$,$x_1$,$y_1$($-1000 \leq x_1,y_1 \leq 1000,0<r_1 \leq 1000$), the radius and the postion of $\textbf{the Scoring Area}$.
In the second line there are three integers $r_2$,$x_2$,$y_2$($-1000 \leq x_2,y_2 \leq 1000,0<r_2 \leq 1000$), the radius and the postion of $\textbf{the Bonus Area}$.
In the third line there is an integer $a$($0<a \leq 1000$), the side length of the square card.

$\textbf{It is guaranteed that the Scoring Area is big enough thus there is always a chance for the play to be scored}$.
输出解释
For each test case, output a decimal $p$($0 \leq p \leq 1$) in one line, the ratio of the possibility of being scored and getting the bonus simultaneously to the possibility of being scored.

$\textbf{Your answer should be rounded to 6 digits after the decimal point.}$
输入样例
1
5 1 2
3 2 1
1
输出样例
0.301720

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

源链接: HDU-7063

最后修改于 2021-10-23T19:11:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)