题意:给你n和r,n为围着中间的圆的外面的圆的个数(有点绕口?),R为中间的圆的半径,问外面的圆的半径r。
题解:数学问题,易得r=R*sin(360/2/n)/(1-sin(360/2/n))。
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define pi 3.1415926
int main()
{
ios::sync_with_stdio(false);
double n,r;
cin>>n>>r;
double du=360*1.0/(n*1.0)/(2*1.0);
double ans,temp;
temp=sin(du*pi/180);
ans=r*temp/(1-temp);
printf("%.8lf\n",ans);
return 0;
}