Friday, June 1, 2018

UVA - 12853 .cpp file

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t, c = 0;
    const double pi = acos(-1);
    double D, N, A;
    scanf("%d", &t);
    while (t--)
    {
        scanf("%lf %lf", &D, &N);
        A = D / (N - 1);
        double ret = 2 * pi * (A + D);
        printf("Case %d: %.3lf\n", ++c, ret);
    }
    return 0;
}

No comments:

Post a Comment