#include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
int main( )
{
int n;
scanf ( "%d" ,& n) ;
double a,b,c,ha,hb,hc,ma,cosa,r,l,res,area;
for ( int i= 0 ; i< n; i++ )
{
scanf ( "%lf %lf %lf %lf" ,& a,& ha,& hb,& hc) ;
//printf("%lf %lf %lf %lf\n",a,ha,hb,hc);
ha* = 3 ; hb* = 3 ; hc* = 3 ;
c= ( a* ha) / hc; b= ( a* ha) / hb;
ma= sqrt ( 0.5 * b* b+ 0.5 * c* c- 0.25 * a* a) ;
cosa= ha/ ma;
r= ( 2 * ma) / 3 ;
l= b* ( b- sqrt ( a* a- hb* hb) ) / ha;
// printf("%lf\n",l*l+r*r-2*cosa*l*r);
res= l* l+ r* r- 2 * cosa* l* r;
if ( res< 0 ) res= 0 ; else res= sqrt ( res) ;
area= a* ha/ 2 ;
printf ( "%.3lf %.3lf\n " ,area,res) ;
}
//system("PAUSE");
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPG1hdGguaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKQp7CiAgICBpbnQgbjsKICAgIHNjYW5mKCIlZCIsJm4pOwogICAgZG91YmxlIGEsYixjLGhhLGhiLGhjLG1hLGNvc2EscixsLHJlcyxhcmVhOwogICAgZm9yIChpbnQgaT0wO2k8bjtpKyspCiAgICB7CiAgICAgICAgc2NhbmYoIiVsZiAlbGYgJWxmICVsZiIsJmEsJmhhLCZoYiwmaGMpOwogICAgICAgIC8vcHJpbnRmKCIlbGYgJWxmICVsZiAlbGZcbiIsYSxoYSxoYixoYyk7CiAgICAgICAgaGEqPTM7aGIqPTM7aGMqPTM7CiAgICAgICAgYz0oYSpoYSkvaGM7IGI9KGEqaGEpL2hiOwogICAgICAgIG1hPXNxcnQoMC41KmIqYiswLjUqYypjLTAuMjUqYSphKTsKICAgICAgICBjb3NhPWhhL21hOwogICAgICAgIHI9KDIqbWEpLzM7CiAgICAgICAgbD1iKihiLXNxcnQoYSphLWhiKmhiKSkvaGE7Ci8vICAgICAgICBwcmludGYoIiVsZlxuIixsKmwrcipyLTIqY29zYSpsKnIpOwogICAgICAgIHJlcz1sKmwrcipyLTIqY29zYSpsKnI7CiAgICAgICAgaWYgKHJlczwwKSByZXM9MDsgZWxzZSByZXM9c3FydChyZXMpOwogICAgICAgIGFyZWE9YSpoYS8yOwogICAgICAgIHByaW50ZigiJS4zbGYgJS4zbGZcbiIsYXJlYSxyZXMpOwogICAgfQogICAgLy9zeXN0ZW0oIlBBVVNFIik7CiAgICByZXR1cm4gMDsKfQo=
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:12: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
stdout
3.897 0.000
149604.790 150.275