不妨设$r1le r2le r3$,令$f(alpha)=E(S_{Delta}ABC)$,其中AB坐标分别为$(r_{1},0)$和$(r_{2}cos alpha,r_{2}sin alpha)$,C在原点为圆心、$r_{3}$为半径的圆上,那么有答案$ans=lim_{n oinfty}limitsfrac{sum_{i=1}^{n}f(frac{2pi i}{n})}{n}$,而由于答案误差可以较大,因此n取1000左右即可
考虑求$f(alpha)$,可以求出$l=|AB|=sqrt{(r_{2}cosalpha-r_{1})^{2}+(r_{2}sin alpha)^{2}}$,作$CHperp AB$交AB于点H,那么有$f(alpha)=frac{lcdot E(CH)}{2}$
考虑求$E(CH)$,延长AB交最大的圆于点D,作$OEverb|//|AB$交最大的圆于点E交CH延长线于点H',那么根据这些可以求出$eta=angle DOE=angle ADO=arcsin frac{r_{1}r_{2}sinalpha}{r_{3}l}$,$h=HH'=r_{3}sineta$,然后对$gamma=angle COA-angle DOA$分类讨论:
1.$etale gamma< pi+eta$,那么$E(CH)=egin{equation*}int_{0}^{pi} h+r_{3}sin(gamma-eta)
m d(gamma-eta)end{equation*}=pi h+2r_{3}$
2.$pi+2eta le gamma<2pi$,那么$E(CH)=egin{equation*}int_{eta}^{pi-eta} (r_{3}sin (gamma-eta-pi)-h)
m d(gamma-eta-pi)end{equation*}=2r_{3}coseta-(pi-2eta)h$
3.$0le gamma<eta$或$pi+etale gamma<pi+2eta$,那么$E(CH)=2egin{equation*}int_{0}^{eta} (h-r_{3}sin (eta-gamma))
m d(eta-gamma)end{equation*}=2eta h+2r_{3}(coseta-1)$
综上,$E(CH)=frac{(pi h+2r_{3})+(2r_{3}coseta-(pi-2eta )h)+(2eta h+2r_{3}(coseta-1))}{2pi}=frac{2eta h+2r_{3}coseta}{pi}$,代入即可得到$f(alpha)=frac{l(eta h+r_{3}coseta)}{pi}$
View Code
1 #include<bits/stdc++.h> 2 using namespace std; 3 #define pi acos(-1.0) 4 int t,r1,r2,r3; 5 double sqr(double a){ 6 return a*a; 7 } 8 double f(double a){ 9 double l=sqrt(sqr(r2*cos(a)-r1)+sqr(r2*sin(a))); 10 double h=r1*r2*sin(a)/l; 11 double b=asin(h/r3); 12 return l*(b*h+cos(b)*r3)/pi; 13 } 14 int main(){ 15 scanf("%d",&t); 16 while (t--){ 17 scanf("%d%d%d",&r1,&r2,&r3); 18 if (r1>r2)swap(r1,r2); 19 if (r1>r3)swap(r1,r3); 20 if (r2>r3)swap(r2,r3); 21 double ans=0; 22 for(int i=1;i<=1000;i++)ans+=f(2*i*pi/1000.0)/1000.0; 23 printf("%.1f ",ans); 24 } 25 }