#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 *, ...);
int /*<<< orphan*/ scanf(char *, ...);
double sqrt(double);
int main() {
  int t;
  double ha, hb, hc, total, root;
  scanf("%d", &t);
  while (t--) {
    while (1) {
      scanf("%lf %lf %lf", &ha, &hb, &hc);
      total = 1 / ((1.0 / ha + 1.0 / hb + 1.0 / hc) *
                   (1.0 / ha + 1.0 / hb - 1.0 / hc) *
                   (1.0 / ha - 1.0 / hb + 1.0 / hc) *
                   (-1.0 / ha + 1.0 / hb + 1.0 / hc));
      if (total < 0 || ha == 0 || hb == 0 || hc == 0) {
        printf("These are invalid inputs!\n");
        break;
      } else {
        root = sqrt(total);
        printf("%.3lf\n", root);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%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     12fc <main+0x1cc>
jmp    116a <main+0x3a>
lea    0xea2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  0xe74(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
movsd  0xe67(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe45(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xe38(%rip),%xmm2
divsd  -0x18(%rbp),%xmm2
addsd  %xmm2,%xmm0
movsd  0xe27(%rip),%xmm2
divsd  -0x20(%rbp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe12(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xe05(%rip),%xmm2
divsd  -0x18(%rbp),%xmm2
subsd  %xmm2,%xmm0
movsd  0xdf4(%rip),%xmm2
divsd  -0x20(%rbp),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xde7(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xdd2(%rip),%xmm2
divsd  -0x18(%rbp),%xmm2
addsd  %xmm2,%xmm0
movsd  0xdc1(%rip),%xmm2
divsd  -0x20(%rbp),%xmm2
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xdac(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
ja     12bd <main+0x18d>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1288 <main+0x158>
jp     1288 <main+0x158>
jmp    12bd <main+0x18d>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12a5 <main+0x175>
jp     12a5 <main+0x175>
jmp    12bd <main+0x18d>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12d0 <main+0x1a0>
jp     12d0 <main+0x1a0>
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f7 <main+0x1c7>
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xd4f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    116a <main+0x3a>
jmp    1151 <main+0x21>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    1179 <main+0x39>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9b(%rip),%r14
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%rbx
lea    0xe98(%rip),%r13
lea    0xe8a(%rip),%rbp
jmp    11af <main+0x6f>
nop
mov    %r13,%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1168 <main+0x28>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm0
unpcklpd %xmm2,%xmm0
movapd 0xe22(%rip),%xmm4
divpd  %xmm0,%xmm4
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
addsd  %xmm4,%xmm0
movsd  0x10(%rsp),%xmm3
movsd  0xe14(%rip),%xmm7
movapd %xmm7,%xmm5
divsd  %xmm3,%xmm5
movapd %xmm0,%xmm6
addsd  %xmm5,%xmm6
subsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm0
movapd %xmm4,%xmm6
shufpd $0x1,%xmm4,%xmm6
subpd  %xmm6,%xmm4
unpcklpd %xmm5,%xmm5
addpd  %xmm4,%xmm5
movapd %xmm5,%xmm4
unpckhpd %xmm5,%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm7,%xmm0
divsd  %xmm4,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm0,%xmm4
ja     11a0 <main+0x60>
ucomisd %xmm4,%xmm2
jne    125b <main+0x11b>
jnp    11a0 <main+0x60>
ucomisd %xmm4,%xmm1
jne    1267 <main+0x127>
jnp    11a0 <main+0x60>
ucomisd %xmm4,%xmm3
jne    1273 <main+0x133>
jnp    11a0 <main+0x60>
ucomisd %xmm4,%xmm0
jb     1280 <main+0x140>
sqrtsd %xmm0,%xmm0
jmp    1285 <main+0x145>
nop
call   1060 <sqrt@plt>
mov    %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11af <main+0x6f>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [27 x i8] c"These are invalid inputs!\0A\00"
@.str.3 = [7 x i8] c"%.3lf\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 = %71, %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 %72
13: ; preds = %9
br label %14
14: ; preds = %13, %70
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4, double* %5)
%16 = load double, double* %3
%17 = fdiv double 1.000000e+00, %16
%18 = load double, double* %4
%19 = fdiv double 1.000000e+00, %18
%20 = fadd double %17, %19
%21 = load double, double* %5
%22 = fdiv double 1.000000e+00, %21
%23 = fadd double %20, %22
%24 = load double, double* %3
%25 = fdiv double 1.000000e+00, %24
%26 = load double, double* %4
%27 = fdiv double 1.000000e+00, %26
%28 = fadd double %25, %27
%29 = load double, double* %5
%30 = fdiv double 1.000000e+00, %29
%31 = fsub double %28, %30
%32 = fmul double %23, %31
%33 = load double, double* %3
%34 = fdiv double 1.000000e+00, %33
%35 = load double, double* %4
%36 = fdiv double 1.000000e+00, %35
%37 = fsub double %34, %36
%38 = load double, double* %5
%39 = fdiv double 1.000000e+00, %38
%40 = fadd double %37, %39
%41 = fmul double %32, %40
%42 = load double, double* %3
%43 = fdiv double -1.000000e+00, %42
%44 = load double, double* %4
%45 = fdiv double 1.000000e+00, %44
%46 = fadd double %43, %45
%47 = load double, double* %5
%48 = fdiv double 1.000000e+00, %47
%49 = fadd double %46, %48
%50 = fmul double %41, %49
%51 = fdiv double 1.000000e+00, %50
store double %51, double* %6
%52 = load double, double* %6
%53 = fcmp olt double %52, 0.000000e+00
br i1 %53, label %63, label %54
54: ; preds = %14
%55 = load double, double* %3
%56 = fcmp oeq double %55, 0.000000e+00
br i1 %56, label %63, label %57
57: ; preds = %54
%58 = load double, double* %4
%59 = fcmp oeq double %58, 0.000000e+00
br i1 %59, label %63, label %60
60: ; preds = %57
%61 = load double, double* %5
%62 = fcmp oeq double %61, 0.000000e+00
br i1 %62, label %63, label %65
63: ; preds = %60, %57, %54, %14
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %71
65: ; preds = %60
%66 = load double, double* %6
%67 = call double @sqrt(double %66)
store double %67, double* %7
%68 = load double, double* %7
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %68)
br label %70
70: ; preds = %65
br label %14
71: ; preds = %63
br label %9
72: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.3 = [7 x i8] c"%.3lf\0A\00"
@str = [26 x i8] c"These are invalid inputs!\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 %54, label %13
13: ; preds = %0, %53
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 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 = insertelement <2 x double> poison, double %16, i64 0
%18 = insertelement <2 x double> %17, double %15, i64 1
%19 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %18
%20 = extractelement <2 x double> %19, i64 0
%21 = extractelement <2 x double> %19, i64 1
%22 = fadd double %21, %20
%23 = load double, double* %4
%24 = fdiv double 1.000000e+00, %23
%25 = fadd double %22, %24
%26 = fsub double %22, %24
%27 = fmul double %25, %26
%28 = shufflevector <2 x double> %19, <2 x double> undef, <2 x i32> <i32 1, i32 0>
%29 = fsub <2 x double> %19, %28
%30 = insertelement <2 x double> poison, double %24, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = fadd <2 x double> %29, %31
%33 = extractelement <2 x double> %32, i64 1
%34 = fmul double %33, %27
%35 = extractelement <2 x double> %32, i64 0
%36 = fmul double %35, %34
%37 = fdiv double 1.000000e+00, %36
%38 = fcmp olt double %37, 0.000000e+00
%39 = fcmp oeq double %15, 0.000000e+00
%40 = select i1 %38, i1 true, i1 %39
%41 = fcmp oeq double %16, 0.000000e+00
%42 = select i1 %40, i1 true, i1 %41
%43 = fcmp oeq double %23, 0.000000e+00
%44 = select i1 %42, i1 true, i1 %43
br i1 %44, label %45, label %50
45: ; preds = %13
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%47 = load i32, i32* %1
%48 = add nsw i32 %47, -1
store i32 %48, i32* %1
%49 = icmp eq i32 %47, 0
br i1 %49, label %54, label %53
50: ; preds = %13
%51 = call double @sqrt(double %37)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %51)
br label %53
53: ; preds = %50, %45
br label %13
54: ; preds = %45, %0
ret i32 0
}