Skip to content

Instantly share code, notes, and snippets.

@completejavascript
Created September 15, 2018 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save completejavascript/387106905a27e41731278df1d9bc6743 to your computer and use it in GitHub Desktop.
Save completejavascript/387106905a27e41731278df1d9bc6743 to your computer and use it in GitHub Desktop.
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
//freopen("input.txt", "r", stdin);
int T;
cin >> T;
for(int tc = 0; tc < T; tc++)
{
double a,b,c,d;
cin >> a >> b >> c >> d;
double p = (a + b + c + d) / 2;
double S = sqrt((p-a)*(p-b)*(p-c)*(p-d));
printf("%.2lf\n", S);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment