Problem Link : http://lightoj.com/volume_showproblem.php?problem=1043
Solution :
#include<bits/stdc++.h>
using namespace std;
int main()
{
double ab,ac,bc,r;
int t;
double ans;
scanf("%d",&t);
for(int ca=1; ca<=t; ca++)
{
cin>>ab>>ac>>bc>>r;
r=(1/r)+1;
ab=ab*ab;
ans=sqrt(ab/r);
printf("Case %d: %f\n",ca,ans);
}
}
Solution :
#include<bits/stdc++.h>
using namespace std;
int main()
{
double ab,ac,bc,r;
int t;
double ans;
scanf("%d",&t);
for(int ca=1; ca<=t; ca++)
{
cin>>ab>>ac>>bc>>r;
r=(1/r)+1;
ab=ab*ab;
ans=sqrt(ab/r);
printf("Case %d: %f\n",ca,ans);
}
}