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