简单几何
代码如下:
#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1.0)
int main ()
{
int t, cnt = 1;
scanf("%d", &t);
while(t--)
{
double R, r, n;
scanf("%lf %lf", &R, &n);
double k = sqrt(2.0/(1-cos(2*PI/n)))+1.0;//大圆圆心到n个小圆中任意一个圆心的距离+r即等于R,k为系数
r = R/k;
printf("Case %d: %f\n", cnt++, r);
}
return 0;
}