fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {int t,x1,x2,y1,y2,r1,r2;
  5. double ans;
  6. scanf("%d",&t);
  7. while(t--)
  8. {
  9. scanf("%d%d%d%d%d%d",&x1,&y1,&r1,&x2,&y2,&r2);
  10. ans = 3.141592653589793238462643383279*((r1*r1)-(r2*r2));
  11. if(ans<0)
  12. ans=ans*(-1);
  13. printf("%0.2f\n",ans);
  14. }
  15. return 0;
  16. }
  17.  
  18.  
Success #stdin #stdout 0s 2252KB
stdin
1
2 2 4 5 2 3
stdout
21.99