5487: Square Card

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:3 解决:1

题目描述

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(1T20), the number of testcases.

For each testcase, there are three lines.
In the first line there are three integers r1,x1,y1(1000x1,y11000,0<r11000), the radius and the postion of the Scoring Area.
In the second line there are three integers r2,x2,y2(1000x2,y21000,0<r21000), the radius and the postion of the Bonus Area.
In the third line there is an integer a(0<a1000), 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(0p1) 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