#include<iostream>
#include<cmath>
#include<iomanip>
#include<cstdio>
using namespace std;
int main(){
int t;
double a,b,c,d,s,max_area;
cin>>t;
cout<<fixed<<setprecision(2);
while(t--){
scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
s=(a+b+c+d)/2;
max_area=sqrt(((s-a)*(s-b)*(s-c)*(s-d)));
printf("%0.2lf\n",max_area);
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNtYXRoPgojaW5jbHVkZTxpb21hbmlwPgojaW5jbHVkZTxjc3RkaW8+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCl7CglpbnQgdDsKCWRvdWJsZSBhLGIsYyxkLHMsbWF4X2FyZWE7CgljaW4+PnQ7Cgljb3V0PDxmaXhlZDw8c2V0cHJlY2lzaW9uKDIpOwoJd2hpbGUodC0tKXsKCQlzY2FuZigiJWxmICVsZiAlbGYgJWxmIiwmYSwmYiwmYywmZCk7CiAgICAgICAgcz0oYStiK2MrZCkvMjsKICAgICAgICBtYXhfYXJlYT1zcXJ0KCgocy1hKSoocy1iKSoocy1jKSoocy1kKSkpOwogICAgICAgIHByaW50ZigiJTAuMmxmXG4iLG1heF9hcmVhKTsKCX0KCXJldHVybiAwOwp9