#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 */
double pow(double, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, ...);
int sqrt(int);
int main() {
  double u, v, w, U, V, W;
  double ans;
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%lf%lf%lf%lf%lf%lf", &U, &V, &w, &W, &v, &u);
    ans = sqrt((4 * u * u * v * v * w * w) -
               ((u * u) * pow(((v * v) + (w * w) - (U * U)), 2)) -
               ((v * v) * pow(((w * w) + (u * u) - (V * V)), 2)) -
               ((w * w) * pow(((u * u) + (v * v) - (W * W)), 2)) +
               ((v * v) + (w * w) - (U * U)) * ((u * u) + (w * w) - (V * V)) *
                   ((v * v) + (u * u) - (W * W))) /
          12;
    printf("%.4lf\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaf(%rip),%rdi
lea    -0x44(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x44(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x44(%rbp)
cmp    $0x0,%eax
je     148e <main+0x34e>
lea    0xe8c(%rip),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x18(%rbp),%r9
lea    -0x10(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  0xe56(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm3
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x20(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x30(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm4
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
movsd  -0x38(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm4
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
mov    $0xc,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xb9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <main+0x24>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xeb3(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x1c(%rsp)
jb     1395 <main+0x255>
lea    0x48(%rsp),%r15
lea    0x40(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x38(%rsp),%rbx
lea    0x28(%rsp),%rbp
lea    0xe92(%rip),%r14
nopl   0x0(%rax)
lea    0x30(%rsp),%rax
mov    %rax,(%rsp)
lea    0xe6b(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm1
mulsd  0xe32(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x28(%rsp),%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm2
movsd  %xmm2,0x50(%rsp)
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0x50(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm4
subsd  %xmm1,%xmm4
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movsd  0x30(%rsp),%xmm2
movapd %xmm0,%xmm3
unpcklpd %xmm2,%xmm3
unpcklpd %xmm1,%xmm1
mulpd  %xmm3,%xmm3
addpd  %xmm1,%xmm3
movsd  0x48(%rsp),%xmm1
movhpd 0x40(%rsp),%xmm1
mulpd  %xmm1,%xmm1
subpd  %xmm1,%xmm3
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  0x38(%rsp),%xmm2
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
subl   $0x1,0x1c(%rsp)
jae    1190 <main+0x50>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [19 x i8] c"%lf%lf%lf%lf%lf%lf\00"
@.str.2 = [7 x i8] c"%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* %9
%13 = add nsw i32 %12, -1
store i32 %13, i32* %9
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %115
15: ; preds = %11
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double* %5, double* %6, double* %4, double* %7, double* %3, double* %2)
%17 = load double, double* %2
%18 = fmul double 4.000000e+00, %17
%19 = load double, double* %2
%20 = fmul double %18, %19
%21 = load double, double* %3
%22 = fmul double %20, %21
%23 = load double, double* %3
%24 = fmul double %22, %23
%25 = load double, double* %4
%26 = fmul double %24, %25
%27 = load double, double* %4
%28 = load double, double* %2
%29 = load double, double* %2
%30 = fmul double %28, %29
%31 = load double, double* %3
%32 = load double, double* %3
%33 = load double, double* %4
%34 = load double, double* %4
%35 = fmul double %33, %34
%36 = call double @llvm.fmuladd.f64(double %31, double %32, double %35)
%37 = load double, double* %5
%38 = load double, double* %5
%39 = fneg double %37
%40 = call double @llvm.fmuladd.f64(double %39, double %38, double %36)
%41 = call double @pow(double %40, i32 2)
%42 = fmul double %30, %41
%43 = fneg double %42
%44 = call double @llvm.fmuladd.f64(double %26, double %27, double %43)
%45 = load double, double* %3
%46 = load double, double* %3
%47 = fmul double %45, %46
%48 = load double, double* %4
%49 = load double, double* %4
%50 = load double, double* %2
%51 = load double, double* %2
%52 = fmul double %50, %51
%53 = call double @llvm.fmuladd.f64(double %48, double %49, double %52)
%54 = load double, double* %6
%55 = load double, double* %6
%56 = fneg double %54
%57 = call double @llvm.fmuladd.f64(double %56, double %55, double %53)
%58 = call double @pow(double %57, i32 2)
%59 = fneg double %47
%60 = call double @llvm.fmuladd.f64(double %59, double %58, double %44)
%61 = load double, double* %4
%62 = load double, double* %4
%63 = fmul double %61, %62
%64 = load double, double* %2
%65 = load double, double* %2
%66 = load double, double* %3
%67 = load double, double* %3
%68 = fmul double %66, %67
%69 = call double @llvm.fmuladd.f64(double %64, double %65, double %68)
%70 = load double, double* %7
%71 = load double, double* %7
%72 = fneg double %70
%73 = call double @llvm.fmuladd.f64(double %72, double %71, double %69)
%74 = call double @pow(double %73, i32 2)
%75 = fneg double %63
%76 = call double @llvm.fmuladd.f64(double %75, double %74, double %60)
%77 = load double, double* %3
%78 = load double, double* %3
%79 = load double, double* %4
%80 = load double, double* %4
%81 = fmul double %79, %80
%82 = call double @llvm.fmuladd.f64(double %77, double %78, double %81)
%83 = load double, double* %5
%84 = load double, double* %5
%85 = fneg double %83
%86 = call double @llvm.fmuladd.f64(double %85, double %84, double %82)
%87 = load double, double* %2
%88 = load double, double* %2
%89 = load double, double* %4
%90 = load double, double* %4
%91 = fmul double %89, %90
%92 = call double @llvm.fmuladd.f64(double %87, double %88, double %91)
%93 = load double, double* %6
%94 = load double, double* %6
%95 = fneg double %93
%96 = call double @llvm.fmuladd.f64(double %95, double %94, double %92)
%97 = fmul double %86, %96
%98 = load double, double* %3
%99 = load double, double* %3
%100 = load double, double* %2
%101 = load double, double* %2
%102 = fmul double %100, %101
%103 = call double @llvm.fmuladd.f64(double %98, double %99, double %102)
%104 = load double, double* %7
%105 = load double, double* %7
%106 = fneg double %104
%107 = call double @llvm.fmuladd.f64(double %106, double %105, double %103)
%108 = call double @llvm.fmuladd.f64(double %97, double %107, double %76)
%109 = fptosi double %108 to i32
%110 = call i32 @sqrt(i32 %109)
%111 = sdiv i32 %110, 12
%112 = sitofp i32 %111 to double
store double %112, double* %8
%113 = load double, double* %8
%114 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %113)
br label %11
115: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [19 x i8] c"%lf%lf%lf%lf%lf%lf\00"
@.str.2 = [7 x i8] c"%.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = bitcast double* %1 to i8*
%9 = bitcast double* %2 to i8*
%10 = bitcast double* %3 to i8*
%11 = bitcast double* %4 to i8*
%12 = bitcast double* %5 to i8*
%13 = bitcast double* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%16 = load i32, i32* %7
%17 = add nsw i32 %16, -1
store i32 %17, i32* %7
%18 = icmp eq i32 %16, 0
br i1 %18, label %95, label %19
19: ; preds = %0, %19
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5, double* %3, double* %6, double* %2, double* %1)
%21 = load double, double* %1
%22 = fmul double %21, 4.000000e+00
%23 = fmul double %21, %22
%24 = load double, double* %2
%25 = fmul double %24, %23
%26 = fmul double %24, %25
%27 = load double, double* %3
%28 = fmul double %27, %26
%29 = fmul double %27, %27
%30 = call double @llvm.fmuladd.f64(double %24, double %24, double %29)
%31 = load double, double* %4
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %32, double %31, double %30)
%34 = call double @pow(double %33, i32 2)
%35 = fneg double %21
%36 = fmul double %21, %35
%37 = fmul double %36, %34
%38 = call double @llvm.fmuladd.f64(double %28, double %27, double %37)
%39 = load double, double* %2
%40 = load double, double* %3
%41 = load double, double* %1
%42 = fmul double %41, %41
%43 = call double @llvm.fmuladd.f64(double %40, double %40, double %42)
%44 = load double, double* %5
%45 = fneg double %44
%46 = call double @llvm.fmuladd.f64(double %45, double %44, double %43)
%47 = call double @pow(double %46, i32 2)
%48 = fneg double %39
%49 = fmul double %39, %48
%50 = call double @llvm.fmuladd.f64(double %49, double %47, double %38)
%51 = load double, double* %3
%52 = load double, double* %1
%53 = load double, double* %2
%54 = fmul double %53, %53
%55 = call double @llvm.fmuladd.f64(double %52, double %52, double %54)
%56 = load double, double* %6
%57 = fneg double %56
%58 = call double @llvm.fmuladd.f64(double %57, double %56, double %55)
%59 = call double @pow(double %58, i32 2)
%60 = fneg double %51
%61 = fmul double %51, %60
%62 = call double @llvm.fmuladd.f64(double %61, double %59, double %50)
%63 = load double, double* %2
%64 = load double, double* %3
%65 = fmul double %64, %64
%66 = load double, double* %4
%67 = load double, double* %1
%68 = insertelement <2 x double> poison, double %63, i64 0
%69 = insertelement <2 x double> %68, double %67, i64 1
%70 = insertelement <2 x double> poison, double %65, i64 0
%71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
%72 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %69, <2 x double> %69, <2 x double> %71)
%73 = load double, double* %5
%74 = insertelement <2 x double> poison, double %66, i64 0
%75 = insertelement <2 x double> %74, double %73, i64 1
%76 = fneg <2 x double> %75
%77 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %76, <2 x double> %75, <2 x double> %72)
%78 = shufflevector <2 x double> %77, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%79 = fmul <2 x double> %77, %78
%80 = extractelement <2 x double> %79, i64 0
%81 = fmul double %67, %67
%82 = call double @llvm.fmuladd.f64(double %63, double %63, double %81)
%83 = load double, double* %6
%84 = fneg double %83
%85 = call double @llvm.fmuladd.f64(double %84, double %83, double %82)
%86 = call double @llvm.fmuladd.f64(double %80, double %85, double %62)
%87 = fptosi double %86 to i32
%88 = call i32 @sqrt(i32 %87)
%89 = sdiv i32 %88, 12
%90 = sitofp i32 %89 to double
%91 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %90)
%92 = load i32, i32* %7
%93 = add nsw i32 %92, -1
store i32 %93, i32* %7
%94 = icmp eq i32 %92, 0
br i1 %94, label %95, label %19
95: ; preds = %19, %0
ret i32 0
}