⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1380.txt

📁 北大ACM题目例程 详细的解答过程 程序实现 算法分析
💻 TXT
字号:

#include"fstream.h"
#include"math.h"


double a,b,x,y,t;
bool canfit()
{
	double t;
	double l=sqrt(x*x+y*y),ll=x*x+y*y;

	if(x*x+y*y>=a*a+b*b)return 0;
	
	if(x<y)
	{
		t=x;x=y;y=t;
	}
	if(a<b)
	{
		t=a;a=b;b=t;
	}
	if(x>=b&&y>=b)return 0;

	double s=(4*x*y*b+sqrt(16*x*x*y*y*b*b-4*ll*(4*x*x*y*y-ll*ll+b*b*ll) ) )/ll/2;
		//s2=(4*x*y*b-sqrt(16*x*x*y*y*b*b-4*ll*(4*x*x*y*y-ll*ll+b*b*ll) ) )/ll/2;
	
	if(s-a>0)return 0;
	else return 1;
}
	



int main()
{
	
	cin>>t;
	while(t--)
	{
		cin>>a>>b>>x>>y;
		
		if((a>x&&b>y)||(b>x&&a>y)||canfit())
			cout<<"Escape is possible."<<endl;
		else cout<<"Box cannot be dropped."<<endl;
	}

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -