F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Square Card

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1220    Accepted Submission(s): 426


Problem Description
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)$.
 

Input
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}$.
 

Output
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.}$
 

Sample Input
1 5 1 2 3 2 1 1
 

Sample Output
0.301720
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-03-28 23:54:50, Gzip enabled