fork download
  1. #include<iostream>
  2. #include<cmath>
  3. #include<iomanip>
  4. #include<cstdio>
  5. using namespace std;
  6. int main(){
  7. int t;
  8. double a,b,c,d,s,max_area;
  9. cin>>t;
  10. cout<<fixed<<setprecision(2);
  11. while(t--){
  12. scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
  13. s=(a+b+c+d)/2;
  14. max_area=sqrt(((s-a)*(s-b)*(s-c)*(s-d)));
  15. printf("%0.2lf\n",max_area);
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 3464KB
stdin
2
1 2 1 2
0.5 0.5 0.5 0.5
stdout
2.00
0.25