#include <iostream>
#include <cmath>
using namespace std;
int Check(double a,double b,double x,double y)
{
if(a*b <= x*y) return 0;
if(a <= x) return 0;
if(a>x && b>y) return 1;
double Dist = sqrt(x*x+y*y);
double angle = asin(a/Dist) - asin(x/Dist);
double L = y*cos(angle) + x*sin(angle);
if(L>b) return 0;
else return 1;
return 0;
}
int main()
{
int T;
double A,B,X,Y;
cin>>T;
while(T--)
{
cin>>A>>B>>X>>Y;
if(A>B) swap(A,B);//保证 A <= B
if(X>Y) swap(X,Y);//保证 X <= Y
if(Check(A,B,X,Y)) cout<<"Escape is possible.\n";
else cout<<"Box cannot be dropped.\n";
}
return 0;
}
大盒放小盒问题。
HDU1110--Equipment Box HDU(87)
最新推荐文章于 2019-04-05 20:56:10 发布