... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-11646 :: Athletics Track

#include <bits/stdc++.h>
using namespace std ;
int main ()
{
    int i=0 ,cas ;
     double r , d ,angl ,s ,ratio ,l,w ;
    char ch ;
    cin>>cas ;
    while (cas--)
    {
        i++ ;
        cin>>l>>ch>>w ;
       angl=atan((w/2)/(l/2)) ;
       r=sqrt((w/2)*(w/2)+(l/2)*(l/2)) ;
       s=r*angl*2.0 ;

      d=2.0*l+2.0*s ;
      ratio=400.0/d ;
      printf ("Case %d: %.10lf %.10lf\n",i,l*ratio , w*ratio) ;

    }
    return 0 ;
}