#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
int main()
{
double r,R;
double m,n,a;
double H,h,yao,r1;
double eps=1e-9;
while(~scanf("%lf%lf",&r,&R))
{
if(R<2*r)
{
printf("NO Solution!\n");continue;
}
m=0;
n=R*sqrt(3)/2;
while(n-m>eps)
{
a=(m+n)/2;
H=sqrt(R*R-a*a);
h=H+R;
yao=sqrt(h*h+a*a);
r1=(a*h)/(yao+a);
if(r1<r)
m=a;
else
n=a;
}
a=(m+n)/2;
H=sqrt(R*R-a*a);
h=H+R;
yao=sqrt(h*h+a*a);
printf("%.18f %.18f %.18f\n",a*2,yao,yao);
}
return 0;
}
ZOJ3806-Incircle and Circumcircle
最新推荐文章于 2018-05-11 10:20:12 发布