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 925 (Div. 3) 1931D. Divisible Pairs Solution

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

Powered by Blogger.