-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathQUADAREA.cpp
34 lines (25 loc) · 851 Bytes
/
QUADAREA.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<bits/stdc++.h>
#define ll long long int
#define watch(x) cout << (#x) << " is " << (x) << endl //watch function print variable and value for debugging
#define count_ones __builtin_popcountll // count_ones(9) is equal to 2 valid for ll also
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define fo(i,n) for(ll i=0;i<n;i++)
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
fast_io
ll t;
cin>>t;
while(t--)
{
double a,b,c,d;
cin>>a>>b>>c>>d;
double sp=(a+b+c+d)/2;
double area=sqrt((sp-a)*(sp-b)*(sp-c)*(sp-d));
cout<<fixed<<setprecision(2)<<(double)area<<"\n";
}
return 0;
}