#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 *, ...);
int main() {
  int n, t, i, j;
  double a[50005];
  scanf("%d", &t);
  for (j = 1; j <= t; j++) {
    scanf("%d", &n);
    for (i = 0; i < n; i++)
      scanf("%lf", &a[i]);
    while (n > 1) {
      for (i = 0; i < n - 1; i++) {
        a[i] = (a[i] + a[i + 1]) / 2;
      }
      n--;
    }
    printf("Case #%d: %.3lf\n", j, a[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61ac0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecf(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1249 <main+0x129>
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11aa <main+0x8a>
movslq -0x10(%rbp),%rax
lea    -0x61ac0(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <main+0x50>
jmp    11af <main+0x8f>
cmpl   $0x1,-0x8(%rbp)
jle    1224 <main+0x104>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1216 <main+0xf6>
movslq -0x10(%rbp),%rax
movsd  -0x61ac0(%rbp,%rax,8),%xmm0
f9 ff
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
addsd  -0x61ac0(%rbp,%rax,8),%xmm0
f9 ff
movsd  0xe09(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x10(%rbp),%rax
movsd  %xmm0,-0x61ac0(%rbp,%rax,8)
f9 ff
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c0 <main+0xa0>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    11af <main+0x8f>
mov    -0x14(%rbp),%esi
movsd  -0x61ac0(%rbp),%xmm0
ff
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x61ac0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x61ab8,%rsp
lea    0xee0(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1389 <main+0x269>
mov    $0x1,%r12d
lea    0x8(%rsp),%r15
lea    0xeba(%rip),%r14
lea    0xeb7(%rip),%r13
jmp    119c <main+0x7c>
nopw   0x0(%rax,%rax,1)
movl   $0x1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    %r13,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
lea    0x1(%r12),%eax
cmp    0xc(%rsp),%r12d
mov    %eax,%r12d
jge    1389 <main+0x269>
lea    0xe75(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1178 <main+0x58>
lea    0x10(%rsp),%rbp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x8,%rbp
cmp    %rax,%rbx
jl     11c0 <main+0xa0>
cmp    $0x2,%eax
jl     1178 <main+0x58>
lea    -0x1(%rax),%r8d
lea    -0x4(%r8),%r10
xor    %esi,%esi
mov    %r8,%rdi
movsd  0xe17(%rip),%xmm5
movapd 0xdff(%rip),%xmm6
jmp    122a <main+0x10a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rax),%ecx
add    $0xffffffffffffffff,%rdi
add    $0x1,%rsi
add    $0xffffffffffffffff,%r10
cmp    $0x2,%eax
mov    %ecx,%eax
jle    1170 <main+0x50>
mov    %r8,%rbp
sub    %rsi,%rbp
movsd  0x10(%rsp),%xmm0
cmp    $0x4,%rbp
jae    1250 <main+0x130>
xor    %ecx,%ecx
jmp    1360 <main+0x240>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x4(%rbp),%rcx
mov    %rcx,%r9
shr    $0x2,%r9
add    $0x1,%r9
unpcklpd %xmm0,%xmm0
cmp    $0x4,%rcx
jae    1270 <main+0x150>
xor    %ebx,%ebx
jmp    1302 <main+0x1e2>
mov    %r10,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
and    $0xfffffffffffffffe,%rcx
xor    %ebx,%ebx
movapd %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
nop
movupd 0x18(%rsp,%rbx,8),%xmm2
movupd 0x28(%rsp,%rbx,8),%xmm3
movupd 0x38(%rsp,%rbx,8),%xmm4
movupd 0x48(%rsp,%rbx,8),%xmm0
shufpd $0x1,%xmm2,%xmm1
addpd  %xmm2,%xmm1
shufpd $0x1,%xmm3,%xmm2
addpd  %xmm3,%xmm2
mulpd  %xmm6,%xmm1
mulpd  %xmm6,%xmm2
movapd %xmm1,0x10(%rsp,%rbx,8)
movapd %xmm2,0x20(%rsp,%rbx,8)
shufpd $0x1,%xmm4,%xmm3
addpd  %xmm4,%xmm3
shufpd $0x1,%xmm0,%xmm4
addpd  %xmm0,%xmm4
mulpd  %xmm6,%xmm3
mulpd  %xmm6,%xmm4
movapd %xmm3,0x30(%rsp,%rbx,8)
movapd %xmm4,0x40(%rsp,%rbx,8)
add    $0x8,%rbx
movapd %xmm0,%xmm1
add    $0xfffffffffffffffe,%rcx
jne    1290 <main+0x170>
mov    %rbp,%rcx
and    $0xfffffffffffffffc,%rcx
test   $0x1,%r9b
je     1351 <main+0x231>
lea    0x0(,%rbx,8),%rdx
or     $0x8,%rdx
movupd 0x10(%rsp,%rdx,1),%xmm1
movupd 0x20(%rsp,%rdx,1),%xmm2
shufpd $0x1,%xmm1,%xmm0
addpd  %xmm1,%xmm0
shufpd $0x1,%xmm2,%xmm1
addpd  %xmm2,%xmm1
mulpd  %xmm6,%xmm0
mulpd  %xmm6,%xmm1
movapd %xmm0,0x10(%rsp,%rbx,8)
movapd %xmm1,0x20(%rsp,%rbx,8)
movapd %xmm2,%xmm0
cmp    %rcx,%rbp
je     1210 <main+0xf0>
unpckhpd %xmm0,%xmm0
xchg   %ax,%ax
movsd  0x18(%rsp,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,0x10(%rsp,%rcx,8)
lea    0x1(%rcx),%rdx
movapd %xmm1,%xmm0
mov    %rdx,%rcx
cmp    %rdx,%rdi
jne    1360 <main+0x240>
jmp    1210 <main+0xf0>
xor    %eax,%eax
add    $0x61ab8,%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 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"Case #%d: %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [50005 x 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* %3)
store i32 1, i32* %5
br label %8
8: ; preds = %62, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %65
12: ; preds = %8
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %4
br label %14
14: ; preds = %23, %12
%15 = load i32, i32* %4
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [50005 x double], [50005 x double]* %6, i64 0, i64 %20
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %21)
br label %23
23: ; preds = %18
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %14
26: ; preds = %14
br label %27
27: ; preds = %54, %26
%28 = load i32, i32* %2
%29 = icmp sgt i32 %28, 1
br i1 %29, label %30, label %57
30: ; preds = %27
store i32 0, i32* %4
br label %31
31: ; preds = %51, %30
%32 = load i32, i32* %4
%33 = load i32, i32* %2
%34 = sub nsw i32 %33, 1
%35 = icmp slt i32 %32, %34
br i1 %35, label %36, label %54
36: ; preds = %31
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [50005 x double], [50005 x double]* %6, i64 0, i64 %38
%40 = load double, double* %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [50005 x double], [50005 x double]* %6, i64 0, i64 %43
%45 = load double, double* %44
%46 = fadd double %40, %45
%47 = fdiv double %46, 2.000000e+00
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [50005 x double], [50005 x double]* %6, i64 0, i64 %49
store double %47, double* %50
br label %51
51: ; preds = %36
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 1
store i32 %53, i32* %4
br label %31
54: ; preds = %31
%55 = load i32, i32* %2
%56 = add nsw i32 %55, -1
store i32 %56, i32* %2
br label %27
57: ; preds = %27
%58 = load i32, i32* %5
%59 = getelementptr inbounds [50005 x double], [50005 x double]* %6, i64 0, i64 0
%60 = load double, double* %59
%61 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %58, double %60)
br label %62
62: ; preds = %57
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %8
65: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"Case #%d: %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50005 x double]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [50005 x double]* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
br i1 %9, label %142, label %10
10: ; preds = %0
%11 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 0
br label %12
12: ; preds = %10, %136
%13 = phi i32 [ 1, %10 ], [ %139, %136 ]
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = icmp sgt i32 %15, 0
br i1 %16, label %22, label %136
17: ; preds = %22
%18 = icmp sgt i32 %27, 1
br i1 %18, label %19, label %136
19: ; preds = %17
%20 = add nsw i32 %27, -1
%21 = zext i32 %20 to i64
br label %30
22: ; preds = %12, %22
%23 = phi i64 [ %26, %22 ], [ 0, %12 ]
%24 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %23
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %24)
%26 = add nuw nsw i64 %23, 1
%27 = load i32, i32* %1
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %26, %28
br i1 %29, label %22, label %17
30: ; preds = %131, %19
%31 = phi i64 [ %134, %131 ], [ 0, %19 ]
%32 = phi i64 [ %133, %131 ], [ %21, %19 ]
%33 = phi i32 [ %39, %131 ], [ %27, %19 ]
%34 = sub i64 %21, %31
%35 = add i64 %34, -4
%36 = lshr i64 %35, 2
%37 = add nuw nsw i64 %36, 1
%38 = sub i64 %21, %31
%39 = add nsw i32 %33, -1
%40 = load double, double* %11
%41 = icmp ult i64 %38, 4
br i1 %41, label %118, label %42
42: ; preds = %30
%43 = and i64 %38, -4
%44 = insertelement <2 x double> poison, double %40, i64 1
%45 = and i64 %37, 1
%46 = icmp ult i64 %35, 4
br i1 %46, label %91, label %47
47: ; preds = %42
%48 = and i64 %37, 9223372036854775806
br label %49
49: ; preds = %49, %47
%50 = phi i64 [ 0, %47 ], [ %88, %49 ]
%51 = phi <2 x double> [ %44, %47 ], [ %78, %49 ]
%52 = phi i64 [ 0, %47 ], [ %89, %49 ]
%53 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %50
%54 = or i64 %50, 1
%55 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %54
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = getelementptr inbounds double, double* %55, i64 2
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = shufflevector <2 x double> %51, <2 x double> %57, <2 x i32> <i32 1, i32 2>
%62 = shufflevector <2 x double> %57, <2 x double> %60, <2 x i32> <i32 1, i32 2>
%63 = fadd <2 x double> %61, %57
%64 = fadd <2 x double> %62, %60
%65 = fmul <2 x double> %63, <double 5.000000e-01, double 5.000000e-01>
%66 = fmul <2 x double> %64, <double 5.000000e-01, double 5.000000e-01>
%67 = bitcast double* %53 to <2 x double>*
store <2 x double> %65, <2 x double>* %67
%68 = getelementptr inbounds double, double* %53, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %66, <2 x double>* %69
%70 = or i64 %50, 4
%71 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %70
%72 = or i64 %50, 5
%73 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %72
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %73, i64 2
%77 = bitcast double* %76 to <2 x double>*
%78 = load <2 x double>, <2 x double>* %77
%79 = shufflevector <2 x double> %60, <2 x double> %75, <2 x i32> <i32 1, i32 2>
%80 = shufflevector <2 x double> %75, <2 x double> %78, <2 x i32> <i32 1, i32 2>
%81 = fadd <2 x double> %79, %75
%82 = fadd <2 x double> %80, %78
%83 = fmul <2 x double> %81, <double 5.000000e-01, double 5.000000e-01>
%84 = fmul <2 x double> %82, <double 5.000000e-01, double 5.000000e-01>
%85 = bitcast double* %71 to <2 x double>*
store <2 x double> %83, <2 x double>* %85
%86 = getelementptr inbounds double, double* %71, i64 2
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %84, <2 x double>* %87
%88 = add nuw i64 %50, 8
%89 = add i64 %52, 2
%90 = icmp eq i64 %89, %48
br i1 %90, label %91, label %49
91: ; preds = %49, %42
%92 = phi <2 x double> [ undef, %42 ], [ %78, %49 ]
%93 = phi i64 [ 0, %42 ], [ %88, %49 ]
%94 = phi <2 x double> [ %44, %42 ], [ %78, %49 ]
%95 = icmp eq i64 %45, 0
br i1 %95, label %114, label %96
96: ; preds = %91
%97 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %93
%98 = or i64 %93, 1
%99 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %98
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %99, i64 2
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = shufflevector <2 x double> %94, <2 x double> %101, <2 x i32> <i32 1, i32 2>
%106 = shufflevector <2 x double> %101, <2 x double> %104, <2 x i32> <i32 1, i32 2>
%107 = fadd <2 x double> %105, %101
%108 = fadd <2 x double> %106, %104
%109 = fmul <2 x double> %107, <double 5.000000e-01, double 5.000000e-01>
%110 = fmul <2 x double> %108, <double 5.000000e-01, double 5.000000e-01>
%111 = bitcast double* %97 to <2 x double>*
store <2 x double> %109, <2 x double>* %111
%112 = getelementptr inbounds double, double* %97, i64 2
%113 = bitcast double* %112 to <2 x double>*
store <2 x double> %110, <2 x double>* %113
br label %114
114: ; preds = %91, %96
%115 = phi <2 x double> [ %92, %91 ], [ %104, %96 ]
%116 = icmp eq i64 %38, %43
%117 = extractelement <2 x double> %115, i64 1
br i1 %116, label %131, label %118
118: ; preds = %30, %114
%119 = phi double [ %117, %114 ], [ %40, %30 ]
%120 = phi i64 [ %43, %114 ], [ 0, %30 ]
br label %121
121: ; preds = %118, %121
%122 = phi double [ %127, %121 ], [ %119, %118 ]
%123 = phi i64 [ %125, %121 ], [ %120, %118 ]
%124 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %123
%125 = add nuw nsw i64 %123, 1
%126 = getelementptr inbounds [50005 x double], [50005 x double]* %3, i64 0, i64 %125
%127 = load double, double* %126
%128 = fadd double %122, %127
%129 = fmul double %128, 5.000000e-01
store double %129, double* %124
%130 = icmp eq i64 %125, %32
br i1 %130, label %131, label %121
131: ; preds = %121, %114
%132 = icmp sgt i32 %33, 2
%133 = add nsw i64 %32, -1
%134 = add i64 %31, 1
br i1 %132, label %30, label %135
135: ; preds = %131
store i32 1, i32* %1
br label %136
136: ; preds = %12, %135, %17
%137 = load double, double* %11
%138 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %13, double %137)
%139 = add nuw nsw i32 %13, 1
%140 = load i32, i32* %2
%141 = icmp slt i32 %13, %140
br i1 %141, label %12, label %142
142: ; preds = %136, %0
ret i32 0
}