hdu 3349 lazy gege
#include<stdio.h> #include<math.h> int main() { int _case; double l,a,b; scanf("%d",&_case); while(_case--) { scanf("%lf %lf %lf",&l,&a,&b); if(a<b) { double t=b; b=a; a=t; } double d=sqrt(2.0)*l/2; if(d>=b/2) { printf("%.4lf\n",b*b/4); } else if(2*d<=b/2) { printf("%.4lf\n",l*l); } else { printf("%.4lf\n",l*l-(2*d-b/2)*(2*d-b/2)); } } return 0; }