#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, ...);
int sqrt(double);
int main() {
  int t;
  double a, b, c;
  double ans;
  double s;
  scanf("%d", &t);
  while (t--) {
    scanf("%lf%lf%lf", &a, &b, &c);
    s = (a + b + c) / 2;
    ans = 0.5 * ((0.25 * sqrt(3) * ((a * a) + (b * b) + (c * c))) +
                 3 * sqrt(s * (s - a) * (s - b) * (s - c)));
    printf("%.2lf\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1268 <main+0x138>
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe69(%rip),%xmm0
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe50(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x21>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     1259 <main+0x129>
lea    0xeb9(%rip),%r14
lea    0x28(%rsp),%r15
lea    0x20(%rsp),%r12
lea    0x18(%rsp),%r13
lea    0xead(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x28(%rsp),%xmm1
addsd  0x20(%rsp),%xmm1
addsd  0x18(%rsp),%xmm1
movsd  0xe53(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe49(%rip),%xmm0
call   1050 <sqrt@plt>
xorps  %xmm5,%xmm5
cvtsi2sd %eax,%xmm5
mulsd  0xe3d(%rip),%xmm5
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm2
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x18(%rsp),%xmm2
mulsd  %xmm0,%xmm4
subsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm5,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
call   1050 <sqrt@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
mulsd  0xdba(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
subl   $0x1,0xc(%rsp)
jae    1180 <main+0x50>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%lf%lf%lf\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %53
13: ; preds = %9
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4, double* %5)
%15 = load double, double* %3
%16 = load double, double* %4
%17 = fadd double %15, %16
%18 = load double, double* %5
%19 = fadd double %17, %18
%20 = fdiv double %19, 2.000000e+00
store double %20, double* %7
%21 = call i32 @sqrt(double 3.000000e+00)
%22 = sitofp i32 %21 to double
%23 = fmul double 2.500000e-01, %22
%24 = load double, double* %3
%25 = load double, double* %3
%26 = load double, double* %4
%27 = load double, double* %4
%28 = fmul double %26, %27
%29 = call double @llvm.fmuladd.f64(double %24, double %25, double %28)
%30 = load double, double* %5
%31 = load double, double* %5
%32 = call double @llvm.fmuladd.f64(double %30, double %31, double %29)
%33 = load double, double* %7
%34 = load double, double* %7
%35 = load double, double* %3
%36 = fsub double %34, %35
%37 = fmul double %33, %36
%38 = load double, double* %7
%39 = load double, double* %4
%40 = fsub double %38, %39
%41 = fmul double %37, %40
%42 = load double, double* %7
%43 = load double, double* %5
%44 = fsub double %42, %43
%45 = fmul double %41, %44
%46 = call i32 @sqrt(double %45)
%47 = mul nsw i32 3, %46
%48 = sitofp i32 %47 to double
%49 = call double @llvm.fmuladd.f64(double %23, double %32, double %48)
%50 = fmul double 5.000000e-01, %49
store double %50, double* %6
%51 = load double, double* %6
%52 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %51)
br label %9
53: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%lf%lf%lf\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast i32* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = icmp eq i32 %10, 0
br i1 %12, label %45, label %13
13: ; preds = %0, %13
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%15 = load double, double* %2
%16 = load double, double* %3
%17 = fadd double %15, %16
%18 = load double, double* %4
%19 = fadd double %17, %18
%20 = fmul double %19, 5.000000e-01
%21 = call i32 @sqrt(double 3.000000e+00)
%22 = sitofp i32 %21 to double
%23 = fmul double %22, 2.500000e-01
%24 = load double, double* %2
%25 = load double, double* %3
%26 = fmul double %25, %25
%27 = call double @llvm.fmuladd.f64(double %24, double %24, double %26)
%28 = load double, double* %4
%29 = call double @llvm.fmuladd.f64(double %28, double %28, double %27)
%30 = fsub double %20, %24
%31 = fmul double %20, %30
%32 = fsub double %20, %25
%33 = fmul double %31, %32
%34 = fsub double %20, %28
%35 = fmul double %33, %34
%36 = call i32 @sqrt(double %35)
%37 = mul nsw i32 %36, 3
%38 = sitofp i32 %37 to double
%39 = call double @llvm.fmuladd.f64(double %23, double %29, double %38)
%40 = fmul double %39, 5.000000e-01
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %40)
%42 = load i32, i32* %1
%43 = add nsw i32 %42, -1
store i32 %43, i32* %1
%44 = icmp eq i32 %42, 0
br i1 %44, label %45, label %13
45: ; preds = %13, %0
ret i32 0
}