#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, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int loop, a, b, c, ans, i = 0, j;
  scanf("%d", &loop);
  for (i = 0; i < loop; i++) {
    scanf("%d", &a);
    b = (a / 2) + 1;
    for (j = 1; j <= a; j++) {
      scanf("%d", &c);
      if (j == b) {
        ans = c;
      }
    }
    printf("Case %d: %d\n", i + 1, ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e5 <main+0xc5>
lea    0xea0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11c2 <main+0xa2>
lea    0xe6c(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11af <main+0x8f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11b4 <main+0x94>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1181 <main+0x61>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x10(%rsp)
jle    11d1 <main+0xb1>
xor    %r12d,%r12d
lea    0xeac(%rip),%rbx
lea    0x14(%rsp),%r13
jmp    117c <main+0x5c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
lea    0xe98(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
cmp    0x10(%rsp),%r12d
jge    11d1 <main+0xb1>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1160 <main+0x40>
mov    %eax,%r14d
shr    $0x1f,%r14d
add    %eax,%r14d
sar    %r14d
xor    %r15d,%r15d
jmp    11bb <main+0x9b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
jge    1160 <main+0x40>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
cmp    %r15d,%r14d
jne    11b0 <main+0x90>
mov    0x14(%rsp),%ebp
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0x18,%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 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %7
br label %10
10: ; preds = %39, %0
%11 = load i32, i32* %7
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %42
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
store i32 1, i32* %8
br label %19
19: ; preds = %31, %14
%20 = load i32, i32* %8
%21 = load i32, i32* %3
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %34
23: ; preds = %19
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%25 = load i32, i32* %8
%26 = load i32, i32* %4
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = load i32, i32* %5
store i32 %29, i32* %6
br label %30
30: ; preds = %28, %23
br label %31
31: ; preds = %30
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %19
34: ; preds = %19
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
%37 = load i32, i32* %6
%38 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37)
br label %39
39: ; preds = %34
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %10
42: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %34
10: ; preds = %0, %28
%11 = phi i32 [ %30, %28 ], [ 0, %0 ]
%12 = phi i32 [ %29, %28 ], [ undef, %0 ]
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 2
%16 = add nsw i32 %15, 1
%17 = icmp slt i32 %14, 1
br i1 %17, label %28, label %18
18: ; preds = %10, %18
%19 = phi i32 [ %25, %18 ], [ 1, %10 ]
%20 = phi i32 [ %24, %18 ], [ %12, %10 ]
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%22 = icmp eq i32 %19, %16
%23 = load i32, i32* %3
%24 = select i1 %22, i32 %23, i32 %20
%25 = add nuw nsw i32 %19, 1
%26 = load i32, i32* %2
%27 = icmp slt i32 %19, %26
br i1 %27, label %18, label %28
28: ; preds = %18, %10
%29 = phi i32 [ %12, %10 ], [ %24, %18 ]
%30 = add nuw nsw i32 %11, 1
%31 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %29)
%32 = load i32, i32* %1
%33 = icmp slt i32 %30, %32
br i1 %33, label %10, label %34
34: ; preds = %28, %0
ret i32 0
}