LightOJ 1072 Solution

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double r, n;
    int t, i = 1;
    cin >> t;
    while(t--)
    {
        cin >> r >> n;
        double c = acos(-1);

        double a = sin(c/n);

        double res = (r*a)/(1.0+a);

        cout << showpoint;
        cout << fixed;
        cout << setprecision(6);

        cout << "Case " << i++ << ": " << res << "\n";
    }

    return 0;
}

Comments