📄 3171825_ac_157ms_276k.cpp
字号:
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
#define pi acos(-1)
int main()
{
double a, b, x, y;
int cas;
cin >> cas;
while(cas-- > 0)
{
cin >> a >> b >> x >> y;
if(a * b <= x * y)
{
cout << "Box cannot be dropped.\n";
continue;
}
if(a < b) swap(a, b);
if(x < y) swap(x, y);
if((a >= x && b >= y)||(x <= b))
{
cout << "Escape is possible.\n";
continue;
}
int flag = 0;
for(double i = 0;i <= 90; i += 0.2)
{
double angle = i * pi / 180;
if(x*cos(angle)+y*sin(angle)<a&&y*cos(angle)+x*sin(angle)<b)
{
cout << "Escape is possible.\n";
flag = 1;
break;
}
}
if(flag == 0)
cout << "Box cannot be dropped.\n";
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -