#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
int t;
cin>>t;
cout<<fixed<<setprecision(2);
while(t--){
double a,b,c,d,s,ar;
cin>>a>>b>>c>>d;
s=(double)((double)(a+b+c+d)/(double)2);
ar=(double)(s-a)*(s-b)*(s-c)*(s-d);
cout<<(double)sqrt(ar)<<endl;
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNtYXRoPgojaW5jbHVkZTxpb21hbmlwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpewoJaW50IHQ7CgljaW4+PnQ7Cgljb3V0PDxmaXhlZDw8c2V0cHJlY2lzaW9uKDIpOwoJd2hpbGUodC0tKXsKCQlkb3VibGUgYSxiLGMsZCxzLGFyOwoJCWNpbj4+YT4+Yj4+Yz4+ZDsKCQlzPShkb3VibGUpKChkb3VibGUpKGErYitjK2QpLyhkb3VibGUpMik7CgkJYXI9KGRvdWJsZSkocy1hKSoocy1iKSoocy1jKSoocy1kKTsKCQljb3V0PDwoZG91YmxlKXNxcnQoYXIpPDxlbmRsOwoJfQoJcmV0dXJuIDA7Cn0g