我承认我读题困难。。。
http://lingyunjinzhu.blog.163.com/blog/static/181015223201191715032413/
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
const double pi = 4.0*atan(1.0);
int main()
{
double b,h,r,c,k,l;
int cases;
cin>>cases;
while(cases--)
{
cin>>b>>h;
l = sqrt(b*b/4+h*h);
k = h;
r = k*b/(b+2*l);
while(r >= 0.000001)
{
k = k-2*r;
r = k*b/(b+2*l);
}
c = pi*(h-r/(b/(b+2*l)));
printf("%13.6lf\n",c);
if(cases)cout<<endl;
}
return 0;
}