struct point{
double x,y;
};
double c(point a, double r1, point b, double r2,double t)
{
double d = sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));
if (d >= r1+r2)
return 0;
//if(d==r1+r2) return t*t;
if (r1>r2){
double tmp = r1;
r1 = r2;
r2 = tmp;
}
if(r2 - r1 >= d)
return pi*r1*r1;
double g1=acos((r1*r1+d*d-r2*r2)/(2*r1*d));
double g2=acos((r2*r2+d*d-r1*r1)/(2*r2*d));
return g1*r1*r1 + g2*r2*r2 - r1*d*sin(g1);
}
int main(){
int _=read;
while(_--){
double x1,y1,r1,x2,y2,r2,a;
cin>>r1>>x1>>y1>>r2>>x2>>y2>>a;
if(r2*r2-a*a/4<=0) puts("0.000000");
else{
double R1=sqrt(r1*r1-a*a/4)-a/2;
double R2=sqrt(r2*r2-a*a/4)-a/2;
//cout<<R1<<" "<<R2<<endl;
point t1={x1,y1},t2={x2,y2};
printf("%.6f\n",c(t1,R1,t2,R2,a)/(pi*R1*R1));
}
}
return 0;
}