Light OJ 1056 - Olympics Solution

 #include<bits/stdc++.h>

using namespace std;

int main()

{

    int t,i;

    double r,s,x,d,a,b;

    cin>>t;

    for(i=1; i<=t; i++)

    {

        scanf("%lf : %lf",&a,&b);

        r = sqrt(b*b + a*a)/2.0;

        d=acos((r*r + r*r - b*b)/(2.0 * r * r));

        s=r*d;

        x=400.0/(2.0*s+2*a);

        printf("Case %d: %.8lf %.8lf\n",i,x*a,x*b);


    }

}


No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.