... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Monday, January 6, 2014

LOJ-1072 :: Calm Down

//Problem link>>http://lightoj.com/volume_showproblem.php?problem=1072

#include <bits/stdc++.h>
#define pi 2.0*acos(0.0)
#define pre setprecision(10)

using namespace std ;
int main ()
{
    int t , i  ;
    cin>>t ;
    for (i=1 ; i<=t ; i++)
    {
        double x , n , R ,r ;
        cin>>R>>n ;
        x=sin(pi/n) ;
        r=(x*R)/(1+x) ;
        cout<<pre<<"Case "<<i<<": "<<r<<endl ;
    }

    return 0 ;
}

1 comment:

  1. I didnt understand .Why did you calculate x ?
    Did you use binary search ?

    ReplyDelete