poj 1905 Expanding Rods 二分

时间:2023-11-23 20:32:14
 /**
题解晚上写
**/
#include <iostream>
#include <math.h>
#include <algorithm>
#include <cstdio>
using namespace std;
const double esp = 1e-;
int main()
{
double l,n,c;
while(cin>>l>>n>>c){
if(l<&&n<&&c<)
break;
double ll;
ll = (+n*c)*l;
double low,high;
low =;
high= l/;
double r,mid;
while(high-low>esp){
mid = (high+low)/2.0;
r = ((mid*mid*)+(l*l))/(*mid);
if(*r*asin(l/(*r))<ll)
low = mid;
else
high = mid;
}
printf("%.3lf\n",high);
}
return ;
}