X-man

导航

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;
}

 

posted on 2013-05-30 14:58  雨钝风轻  阅读(213)  评论(0编辑  收藏  举报