hdu 1110 Equipment Box
//31MS 236K 715 B C++ //数学题,注意斜着放的情况 #include<stdio.h> #include<math.h> bool deal(double a,double b,double x,double y) { if(a>x && b>y) return true; if(a*b <= x*y) return false; if(b<=y) return false; double dis=sqrt(x*x+y*y); double angle=asin(b/dis)-asin(y/dis); double len=x*cos(angle)+y*sin(angle); if(len>a) return false; return true; } int main(void) { double a,b,x,y; int t; scanf("%d",&t); while(t--) { scanf("%lf%lf%lf%lf",&a,&b,&x,&y); if(a<b){ double t0=a;a=b;b=t0; } if(x<y){ double t0=x;x=y;y=t0; } if(deal(a,b,x,y)) puts("Escape is possible."); else puts("Box cannot be dropped."); } return 0; }