滴答滴答---题目链接
Let d be the diameter of a circle with center c = (a, b). A square has been drawn inside that circle such that its vertices lies at the circle's circumference. Four circles have been drawn on the square's sides such that the diameter of each circle is the side of the square, as shown in the figure below.
Your task is to calculate the shaded area in the figure for a given d. Can you?
Input
The first line contains an integer T (1 ≤ T ≤ 105), in which T is the number of test cases.
Each test case consists of a line containing an three integers a, b, and d ( - 109 ≤ a, b ≤ 109) (1 ≤ d ≤ 109), giving the center and the diameter of a circle.
Output
For each test case, print a single line containing shaded area.
Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6.
Example
Input
1
2 3 8
Output
32
#include
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int a,b,d;
scanf("%d%d%d",&a,&b,&d);
double r=d/2.0;
double ans=3.14*r*r;
double p=d/sqrt(2.0);
double r1=p/2.0;
double sum=2*3.14*r1*r1;
ans=sum-ans+p*p;
printf("%lf\n",ans);
}
return 0;
}