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';
        for(int i=0;i<400;i++){
            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<<' '<<mid<<' '<<l<<' '<<r<<'\n';
            if(ch>k){
                l=mid;
            }
            else{
                r=mid;
            }
            //cout<<l<<' '<<ch<<' '<<mid<<' '<<r<<'\n';
        }
        if(fabs(teta-l)<eps)cout<<sqrt(pA/k/pi)-10*eps<<'\n';
        else cout<<a/(2.0*tan(teta))/cos(l)-10*eps<<'\n';
        //OK(ok);
    }


    return 0;
}
/*


*/
Copy
I Shot the Sheriff Wise-ard
GNU G++17
1 ms
920 KB
Accepted
Test Case #1
1 ms
360 KB
Accepted
Input
5 3 8636
Output
2.370480611286
Judge Output
2.3704806113
Checker Message
found '2.3704806113', expected '2.3704806113', error '0.0000000000'
Test Case #2
0 ms
516 KB
Accepted
Input
3 10 10000
Output
2.886751345938
Judge Output
2.8867513460
Checker Message
found '2.8867513459', expected '2.8867513460', error '0.0000000000'
Test Case #3
0 ms
576 KB
Accepted
Input
3 10 7837
Output
3.848431367650
Judge Output
3.8484313677
Checker Message
found '3.8484313676', expected '3.8484313677', error '0.0000000000'
Test Case #4
0 ms
648 KB
Accepted
Input
3 10 1073
Output
11.333799374118
Judge Output
11.3337993741
Checker Message
found '11.3337993741', expected '11.3337993741', error '0.0000000000'
Test Case #5
0 ms
824 KB
Accepted
Input
10 100 10000
Output
153.884176858753
Judge Output
153.8841768598
Checker Message
found '153.8841768588', expected '153.8841768598', error '0.0000000000'
Test Case #6
0 ms
700 KB
Accepted
Input
10 100 9599
Output
159.564664234700
Judge Output
159.5646642347
Checker Message
found '159.5646642347', expected '159.5646642347', error '0.0000000000'
Test Case #7
0 ms
700 KB
Accepted
Input
10 100 6745
Output
190.553123368124
Judge Output
190.5531233681
Checker Message
found '190.5531233681', expected '190.5531233681', error '0.0000000000'
Test Case #8
0 ms
708 KB
Accepted
Input
100 1000 10000
Output
15910.257976886970
Judge Output
15910.2579769054
Checker Message
found '15910.2579768870', expected '15910.2579769054', error '0.0000000000'
Test Case #9
0 ms
708 KB
Accepted
Input
100 1000 9998
Output
15913.808300171979
Judge Output
15913.8083001720
Checker Message
found '15913.8083001720', expected '15913.8083001720', error '0.0000000000'
Test Case #10
0 ms
708 KB
Accepted
Input
100 1000 143
Output
133070.153507340925
Judge Output
133070.1535073409
Checker Message
found '133070.1535073409', expected '133070.1535073409', error '0.0000000000'
Test Case #11
0 ms
712 KB
Accepted
Input
500 10000 10000
Output
795764.243456403495
Judge Output
795764.2434566796
Checker Message
found '795764.2434564035', expected '795764.2434566796', error '0.0000000000'
Test Case #12
0 ms
712 KB
Accepted
Input
500 10000 9999
Output
795809.270899070468
Judge Output
795809.2708990704
Checker Message
found '795809.2708990704', expected '795809.2708990704', error '0.0000000000'
Test Case #13
0 ms
716 KB
Accepted
Input
500 10000 2469
Output
1601499.227238485037
Judge Output
1601499.2272384847
Checker Message
found '1601499.2272384851', expected '1601499.2272384847', error '0.0000000000'
Test Case #14
0 ms
716 KB
Accepted
Input
276 2176 9999
Output
95587.354507908853
Judge Output
95587.3545079089
Checker Message
found '95587.3545079089', expected '95587.3545079089', error '0.0000000000'
Test Case #15
0 ms
728 KB
Accepted
Input
463 1241 9999
Output
91451.595642996817
Judge Output
91451.5956429968
Checker Message
found '91451.5956429968', expected '91451.5956429968', error '0.0000000000'
Test Case #16
0 ms
756 KB
Accepted
Input
124 6754 9998
Output
133288.871279290960
Judge Output
133288.8712792910
Checker Message
found '133288.8712792910', expected '133288.8712792910', error '0.0000000000'
Test Case #17
0 ms
756 KB
Accepted
Input
322 1287 9999
Output
65958.288183895280
Judge Output
65958.2881838953
Checker Message
found '65958.2881838953', expected '65958.2881838953', error '0.0000000000'
Test Case #18
0 ms
760 KB
Accepted
Input
499 9999 9999
Output
794138.209627899138
Judge Output
794138.2096278991
Checker Message
found '794138.2096278991', expected '794138.2096278991', error '0.0000000000'
Test Case #19
0 ms
760 KB
Accepted
Input
125 4682 9997
Output
93149.284944978960
Judge Output
93149.2849449790
Checker Message
found '93149.2849449790', expected '93149.2849449790', error '0.0000000000'
Test Case #20
0 ms
760 KB
Accepted
Input
34 3135 9977
Output
16955.590054357371
Judge Output
16955.5900543574
Checker Message
found '16955.5900543574', expected '16955.5900543574', error '0.0000000000'
Test Case #21
0 ms
764 KB
Accepted
Input
4 19 9780
Output
9.937074272638
Judge Output
9.9370742726
Checker Message
found '9.9370742726', expected '9.9370742726', error '0.0000000000'
Test Case #22
0 ms
764 KB
Accepted
Input
77 261 9998
Output
3197.611067439002
Judge Output
3197.6110674390
Checker Message
found '3197.6110674390', expected '3197.6110674390', error '0.0000000000'
Test Case #23
0 ms
764 KB
Accepted
Input
12 125 9618
Output
240.592669167322
Judge Output
240.5926691673
Checker Message
found '240.5926691673', expected '240.5926691673', error '0.0000000000'
Test Case #24
0 ms
788 KB
Accepted
Input
35 28 9968
Output
155.997809560785
Judge Output
155.9978095608
Checker Message
found '155.9978095608', expected '155.9978095608', error '0.0000000000'
Test Case #25
0 ms
920 KB
Accepted
Input
500 10000 100
Output
7957694.794407141933
Judge Output
7957694.7944071414
Checker Message
found '7957694.7944071423', expected '7957694.7944071414', error '0.0000000000'
Test Case #26
0 ms
784 KB
Accepted
Input
3 1 100
Output
3.712576246418
Judge Output
3.7125762464
Checker Message
found '3.7125762464', expected '3.7125762464', error '0.0000000000'