Thursday 19 May 2011

uva 11646-Athelatic Track

#include<stdio.h>
#include<math.h>
int main()
{
    int a,b,t=1;double ang,x;
    //freopen("in.txt","r",stdin);
    while(scanf("%d : %d",&a,&b)==2)
    {
        ang=acos(double(a*a-b*b)/(a*a+b*b));
        x=400/(2*a+ang*sqrt(a*a+b*b));
        printf("Case %d: %.10f %.10f\n",t++,a*x,b*x);
    }
    return(0);
}

No comments:

Post a Comment