#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, double);
int /*<<< orphan*/ scanf(char *, ...);
double sqrt(int);
int main() {
  int t, i;
  long long int r;
  double x, y;
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%lld", &r);
    x = sqrt((4 * r * r) - 0.25);
    y = sqrt((4 * r * r) - (x * x));
    printf("Case %d: %.2lf\n", i, (x * x) + y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     121f <main+0xef>
lea    0xea0(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
imul   -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xe70(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
imul   -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe04(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11e8 <main+0xb8>
lea    0xeac(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xea5(%rip),%rbx
xor    %ebp,%ebp
nopl   (%rax)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%rax
imul   %rax,%rax
shl    $0x2,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xe63(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
mov    0x8(%rsp),%rax
imul   %rax,%rax
shl    $0x2,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <sqrt@plt>
addsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebp
jl     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lld\00"
@.str.2 = [16 x i8] c"Case %d: %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %31, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %28, %8 ], [ 1, %0 ]
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%11 = load i64, i64* %2
%12 = shl nsw i64 %11, 2
%13 = mul nsw i64 %12, %11
%14 = sitofp i64 %13 to double
%15 = fadd double %14, -2.500000e-01
%16 = fptosi double %15 to i32
%17 = call double @sqrt(i32 %16)
%18 = load i64, i64* %2
%19 = shl nsw i64 %18, 2
%20 = mul nsw i64 %19, %18
%21 = sitofp i64 %20 to double
%22 = fneg double %17
%23 = call double @llvm.fmuladd.f64(double %22, double %17, double %21)
%24 = fptosi double %23 to i32
%25 = call double @sqrt(i32 %24)
%26 = call double @llvm.fmuladd.f64(double %17, double %17, double %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %9, double %26)
%28 = add nuw nsw i32 %9, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %9, %29
br i1 %30, label %8, label %31
31: ; preds = %8, %0
ret i32 0
}