forked from Ouditchya/SPOJ
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGARDENAR.cpp
More file actions
37 lines (24 loc) · 808 Bytes
/
Copy pathGARDENAR.cpp
File metadata and controls
37 lines (24 loc) · 808 Bytes
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
35
36
37
// AC , ALGO : High School Maths.
/*
Helpful Link : http://www.gogeometry.com/problem/p103_equilateral_triangle_heron_area_elearning.htm
*/
// For any clarifications, contact me at : osinha6792@gmail.com
#include<cstdio>
#include<cmath>
#define ROOT_3 1.7320508075688772935274463
using namespace std ;
int main( )
{
int t ;
double area , d , e , f , s ;
scanf("%d",&t) ;
while( t-- )
{
scanf("%lf %lf %lf",&d,&e,&f) ;
area = ( ROOT_3 * ( d * d + e * e + f * f ) ) / 8 ;
s = ( d + e + f ) / 2 ;
area += ( 1.5 * sqrt( s * ( s - d ) * ( s - e ) * ( s - f ) ) ) ;
printf("%0.2lf\n",area) ;
}
return 0 ;
}