#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 fabs(double);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, ...);
double sqrt(double);
int main() {
  double d, v, u, tmin, tstraight, w, dif;
  int i, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lf %lf %lf", &d, &v, &u);
    tmin = d / u;
    w = u * u - v * v;
    if (w > 0) {
      tstraight = d / sqrt(w);
      dif = fabs(tstraight - tmin);
    }
    if (w <= 0 || v == 0) {
      printf("Case %d: can't determine\n", i);
    } else {
      printf("Case %d: %.3lf\n", i, dif);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     127b <main+0x14b>
lea    0xea8(%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
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1216 <main+0xe6>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movaps 0xdf3(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jae    123c <main+0x10c>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1252 <main+0x122>
jp     1252 <main+0x122>
mov    -0x44(%rbp),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1268 <main+0x138>
mov    -0x44(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
lea    0xdd8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    126d <main+0x13d>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x50,%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    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    127f <main+0x14f>
lea    0xeb0(%rip),%r14
lea    0x28(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x20(%rsp),%rbx
lea    0xec0(%rip),%rbp
xor    %r13d,%r13d
jmp    119c <main+0x6c>
xchg   %ax,%ax
lea    0xe98(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    0x4(%rsp),%r13d
jge    127f <main+0x14f>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x20(%rsp),%xmm4
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm4,%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm1,%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
jbe    1247 <main+0x117>
movsd  0x28(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
jb     11f0 <main+0xc0>
xorps  %xmm0,%xmm0
sqrtsd %xmm3,%xmm0
jmp    1215 <main+0xe5>
nop
movapd %xmm3,%xmm0
movapd %xmm3,0x40(%rsp)
movapd %xmm4,0x30(%rsp)
call   1050 <sqrt@plt>
movapd 0x30(%rsp),%xmm4
movapd 0x40(%rsp),%xmm3
xorpd  %xmm1,%xmm1
movapd 0x10(%rsp),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm4,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
subsd  %xmm0,%xmm2
andpd  0xdc5(%rip),%xmm2
movapd %xmm2,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0x1,%r13d
ucomisd %xmm3,%xmm1
jae    1180 <main+0x50>
ucomisd %xmm1,%xmm0
jne    1261 <main+0x131>
jnp    1180 <main+0x50>
mov    %rbp,%rdi
mov    %r13d,%esi
movapd 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
cmp    0x4(%rsp),%r13d
jl     119c <main+0x6c>
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 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [26 x i8] c"Case %d: can't determine\0A\00"
@.str.3 = [16 x i8] c"Case %d: %.3lf\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
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
store i32 1, i32* %9
br label %12
12: ; preds = %53, %0
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %56
16: ; preds = %12
%17 = 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)
%18 = load double, double* %2
%19 = load double, double* %4
%20 = fdiv double %18, %19
store double %20, double* %5
%21 = load double, double* %4
%22 = load double, double* %4
%23 = load double, double* %3
%24 = load double, double* %3
%25 = fmul double %23, %24
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double %21, double %22, double %26)
store double %27, double* %7
%28 = load double, double* %7
%29 = fcmp ogt double %28, 0.000000e+00
br i1 %29, label %30, label %39
30: ; preds = %16
%31 = load double, double* %2
%32 = load double, double* %7
%33 = call double @sqrt(double %32)
%34 = fdiv double %31, %33
store double %34, double* %6
%35 = load double, double* %6
%36 = load double, double* %5
%37 = fsub double %35, %36
%38 = call double @llvm.fabs.f64(double %37)
store double %38, double* %8
br label %39
39: ; preds = %30, %16
%40 = load double, double* %7
%41 = fcmp ole double %40, 0.000000e+00
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = load double, double* %3
%44 = fcmp oeq double %43, 0.000000e+00
br i1 %44, label %45, label %48
45: ; preds = %42, %39
%46 = load i32, i32* %9
%47 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %46)
br label %52
48: ; preds = %42
%49 = load i32, i32* %9
%50 = load double, double* %8
%51 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %49, double %50)
br label %52
52: ; preds = %48, %45
br label %53
53: ; preds = %52
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %12
56: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [26 x i8] c"Case %d: can't determine\0A\00"
@.str.3 = [16 x i8] c"Case %d: %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 1
br i1 %11, label %49, label %12
12: ; preds = %0, %45
%13 = phi i32 [ %46, %45 ], [ 1, %0 ]
%14 = phi double [ %37, %45 ], [ undef, %0 ]
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%16 = load double, double* %3
%17 = load double, double* %2
%18 = fneg double %17
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %16, double %16, double %19)
%21 = fcmp ogt double %20, 0.000000e+00
br i1 %21, label %22, label %35
22: ; preds = %12
%23 = load double, double* %1
%24 = call double @sqrt(double %20)
%25 = insertelement <2 x double> poison, double %23, i64 0
%26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> zeroinitializer
%27 = insertelement <2 x double> poison, double %24, i64 0
%28 = insertelement <2 x double> %27, double %16, i64 1
%29 = fdiv <2 x double> %26, %28
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%31 = fsub <2 x double> %29, %30
%32 = extractelement <2 x double> %31, i64 0
%33 = call double @llvm.fabs.f64(double %32)
%34 = load double, double* %2
br label %35
35: ; preds = %22, %12
%36 = phi double [ %34, %22 ], [ %17, %12 ]
%37 = phi double [ %33, %22 ], [ %14, %12 ]
%38 = fcmp ole double %20, 0.000000e+00
%39 = fcmp oeq double %36, 0.000000e+00
%40 = select i1 %38, i1 true, i1 %39
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %45
43: ; preds = %35
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %13, double %37)
br label %45
45: ; preds = %41, %43
%46 = add nuw nsw i32 %13, 1
%47 = load i32, i32* %4
%48 = icmp slt i32 %13, %47
br i1 %48, label %12, label %49
49: ; preds = %45, %0
ret i32 0
}