#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
const double pi=acos(-1.0);
double x,y,l,w,s;
double cal(double k){//函数的求法是个问题,变量是角度
s=l*cos(k)+w*sin(k)-x;
return s*tan(k)+w*cos(k);
}
int main(){
while(scanf("%lf%lf%lf%lf",&x,&y,&l,&w)==4){
//if(x+1e-6<w || y+1e-6<w){cout<<"no"<<endl;continue;}
double low=0,high=pi/2;//pi/2不是90
bool flag=true;
while(fabs(low-high)>1e-6 && flag){
double lmid=(low*2+high)/3;
double rmid=(low+high*2)/3;
if(cal(lmid)>cal(rmid)){
if(cal(lmid)>y)flag=false;
high=rmid;
}
else {
if(cal(rmid)>y)flag=false;
low=lmid;
}
}if(flag)
cout<<"yes"<<endl;
else cout<<"no"<<endl;
}
return 0;
}
hdu2438Turn the corner 三分
最新推荐文章于 2019-10-17 16:16:48 发布