#include <cstdio>
#include <cmath>
#define PI (M_PI)
#define u (PI-2*atan(x/mid))
#define v 2*((x/(tan(u)))+mid)*u
const double eps = 1e-11;
int main()
{
double l, n, c, x, y, r, L;
double low, high, mid;
int t, cas = 1;
scanf("%d",&t);
while(t--)
{
scanf("%lf%lf%lf",&l,&n,&c);
x = l/2;
L = (1.0+n*c)*l;
low = 0.0, high = x;
mid = (low + high) /2;
while(high-low > eps)//依旧二分
{
if(v > L) high = mid;
else low = mid;
mid = (low + high) /2;
}
printf("Case %d: %.9lf\n",cas++,mid);
}
return 0;
}
light oj 1137 - Expanding Rods
最新推荐文章于 2017-03-25 10:41:00 发布