Source Code
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long
#define ld long double
#define pb push_back
#define F first
#define S second

using namespace std;

const ll Mod=1e9+7;

ll poww(ll a,ll b,ll mod){
    ll res=1;if(b<0)b=(b%(mod-1)+mod-1)%(mod-1);
    for(;b;b>>=1,a=1ll*a*a%mod)
      if(b&1)res=1ll*res*a%mod;
    return res;
}

void Max(ll& x,ll y){
x=max(x,y);
}
void Min(ll& x,ll y){
x=min(x,y);
}

void OK(bool yes){
    cout<<(yes?"YES\n":"NO\n");
}

const ll N=500500,M=2010,LN=(1<<24),K=17,Mx=3e5,inf=3e18;
const ld pi=acos(-1),eps=1e-12;

ll a[N];
ld root(ld x){
ld mn=1e-10,mx=10000000.0;
while(mn<mx){
    ld mid=(mn+mx)/2.0;
    if(fabs(mid*mid-x)<eps){
        return mid;
    }
    if(mid*mid>x){
        mx=mid;
    }
    else{
        mn=mid;
    }
}
}
ld roott(ld x){
ld mn=1e-10,mx=10000000.0;
while(mn<mx){
    ld mid=(mn+mx)/2.0;
    if(mid*mid-x<eps&&mid*mid>x){
        return mid;
    }
    if(mid*mid>x){
        mx=mid;
    }
    else{
        mn=mid;
    }
}
}


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

    //freopen("triangles.in","r",stdin);

    int T=1;
    //cin>>T;
    while(T--){
        int n,a;
        ld k;
        cin>>n>>a>>k;
        k/=10000.0;
        ld teta=pi/(1.0*n);
        ld pA=a/(2.0*tan(teta))*a/2.0*n;
        //ld l=a/(2.0*tan(teta)),r=a/root(2-2*cos(2.0*teta))+0.1;
        ld l=0,r=teta;
        ld mn=l;
        cout<<fixed<<setprecision(12);
        //cout<<pA<<'\n';

        //cout<<l<<' '<<r<<' '<<cos(teta)<<'\n';
        while(fabs(r-l)>=eps){
            ld mid=(l+r)/2.0;
            ld mk=mid*mid-l*l;
            ld ch=1.0-(1.0*n)/pi*(mid-sin(mid)*cos(mid));
          //  cout<<ch<<'\n';
            if(fabs(ch-k)<eps){
                cout<<a/(2.0*tan(teta))/cos(mid)-10*eps<<'\n';
                return 0;
            }
            if(ch>k){
                l=mid;
            }
            else{
                r=mid;
            }
            //cout<<l<<' '<<ch<<' '<<mid<<' '<<r<<'\n';
        }
        cout<<roott(pA/k/pi)-10*eps<<'\n';
        //OK(ok);
    }


    return 0;
}
/*


*/
Copy
I Shot the Sheriff Wise-ard
GNU G++17
0 ms
516 KB
Wrong Answer
Test Case #1
0 ms
360 KB
Accepted
Input
5 3 8636
Output
2.370480611285
Judge Output
2.3704806113
Checker Message
found '2.3704806113', expected '2.3704806113', error '0.0000000000'
Test Case #2
0 ms
516 KB
Wrong Answer
Input
3 10 10000
Output
2.886751351835
Judge Output
2.8867513460
Checker Message
1st numbers differ - expected: '2.8867513460', found: '2.8867513518', error = '0.0000000020'