Problem 3804 --Square Card

3804: Square Card

"
Time Limit $1$ 秒/Second(s) Memory Limit $128$ 兆字节/Megabyte(s)
提交总数 $0$ 正确数量 $0$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
Eric is playing a game on an infinite plane. 

On the plane, there is a circular area with radius r1 called 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 the Scoring Area, the current play will be scored.

There is another circular area with radius r2 called 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 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 the Scoring Area are (x1,y1).
The coordinates of the centre of the Bonus Area are (x2,y2).
The first line contains a number T(1≤T≤20), the number of testcases.

For each testcase, there are three lines.
In the first line there are three integers r1,x1,y1(−1000≤x1,y1≤1000,0<r1≤1000), the radius and the postion of the Scoring Area.
In the second line there are three integers r2,x2,y2(−1000≤x2,y2≤1000,0<r2≤1000), the radius and the postion of the Bonus Area.
In the third line there is an integer a(0<a≤1000), the side length of the square card.

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≤p≤1) in one line, the ratio of the possibility of being scored and getting the bonus simultaneously to the possibility of being scored.

Your answer should be rounded to 6 digits after the decimal point.
1
5 1 2
3 2 1
1
0.301720

推荐代码 查看3804 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$ $ms]
内存最少[$ $KB]
第一AC
第一挑战

赛题来源/所属竞赛 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛