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

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.