
#include<iostream>#include<cstdio>#include<vector>#include<queue>#include<cstring>#include<cmath>#include<algorithm>using namespace std;#define N 10002#define ll long long#define pi acos(-1.0)int main(){double k,h,a,b;while(scanf("%lf",&k)!=EOF){scanf("%lf%lf%lf",&h,&a,&b);double angle = 90-2*k;angle = angle*pi/180;double tx = cos(angle);double ty = sin(angle);if(a>h) { tx = -tx;ty = -ty; a = a-h; }else a = h-a;double x = a*tx;double y = h+a*ty;double ans = sqrt(y*y+(x-b)*(x-b));printf("%.2lfn",ans);}}欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)