| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Help!#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
double pi=asin(1.0f);
double GetAng(double R){
double re,mid,hig = pi,low=0;
while( hig-low > 10e-8){
mid = (hig+low)/2.0f;
re = mid/sin(mid);
if(re>R)hig=mid;
else if(re<R)low=mid;
else break;
}
return mid;
}
int main(void){
double L,n,C,a;
while(true){
scanf("%lf %lf %lf",&L,&n,&C);
if(L<0 || n<0 || C<0)break;
a = GetAng(1.0f+n*C);
printf("%.3lf\n", L*( (1.0f-cos(a)) / (2*sin(a))) );
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator