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

Tuesday, December 31, 2013

LOJ-1043 :: Triangle Partitioning

#include <bits/stdc++.h>
using namespace std ;
int main ()
{
    int  t ,it ;
    cin>>t ;
    for (it=1 ; it<=t ; it++)
    {
        double a,b,c, r ,s ,R,p,q ,d ;
        cin>>a>>b>>c>>r ;

        s=(a+b+c)/2 ;
        p=sqrt(s*(s-a)*(s-b)*(s-c)) ;
        q= (p*r)/(1+r)  ;
        d= sqrt( (q/p)*a*a) ;
 
       printf ("Case %d: %.10lf\n",it , d) ;

    }

    return 0 ;
}