#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 determineMinStrengthFactor(int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int heightArr[100001], mSize, T, caseId, i;
  scanf("%d", &T);
  caseId = 1;
  while (caseId <= T) {
    scanf("%d", &mSize);
    mSize++;
    heightArr[0] = 0;
    for (i = 1; i < mSize; i++)
      scanf("%d", &heightArr[i]);
    printf("Case %d: %d\n", caseId,
           determineMinStrengthFactor(heightArr, mSize));
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61ab0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x61a98(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x61a9c(%rbp)
mov    -0x61a9c(%rbp),%eax
cmp    -0x61a98(%rbp),%eax
jg     1234 <main+0x104>
lea    0xe88(%rip),%rdi
lea    -0x61a94(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x61a94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a94(%rbp)
movl   $0x0,-0x61a90(%rbp)
movl   $0x1,-0x61aa0(%rbp)
mov    -0x61aa0(%rbp),%eax
cmp    -0x61a94(%rbp),%eax
jge    11ee <main+0xbe>
movslq -0x61aa0(%rbp),%rax
lea    -0x61a90(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe2b(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x61aa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61aa0(%rbp)
jmp    11a7 <main+0x77>
mov    -0x61a9c(%rbp),%eax
mov    %eax,-0x61aa4(%rbp)
lea    -0x61a90(%rbp),%rdi
mov    -0x61a94(%rbp),%esi
call   1050 <determineMinStrengthFactor@plt>
mov    -0x61aa4(%rbp),%esi
mov    %eax,%edx
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x61a9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61a9c(%rbp)
jmp    115f <main+0x2f>
xor    %eax,%eax
add    $0x61ab0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x61a98,%rsp
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ff <main+0xcf>
mov    $0x1,%r14d
lea    0xe96(%rip),%rbx
lea    0x10(%rsp),%r12
lea    0xe8d(%rip),%r13
jmp    11a3 <main+0x73>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1050 <determineMinStrengthFactor@plt>
mov    %r13,%rdi
mov    %r14d,%esi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0x1(%r14),%eax
cmp    0xc(%rsp),%r14d
mov    %eax,%r14d
jge    11ff <main+0xcf>
mov    %rbx,%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0x8(%rsp)
movl   $0x0,0x10(%rsp)
test   %eax,%eax
jle    1180 <main+0x50>
mov    $0x1,%r15d
lea    0x14(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <scanf@plt>
add    $0x1,%r15
movslq 0x8(%rsp),%rsi
add    $0x4,%rbp
cmp    %rsi,%r15
jl     11e0 <main+0xb0>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x61a98,%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 [100001 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 1, i32* %5
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %37
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = getelementptr inbounds [100001 x i32], [100001 x i32]* %2, i64 0, i64 0
store i32 0, i32* %16
store i32 1, i32* %6
br label %17
17: ; preds = %26, %12
%18 = load i32, i32* %6
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100001 x i32], [100001 x i32]* %2, i64 0, i64 %23
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %21
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %17
29: ; preds = %17
%30 = load i32, i32* %5
%31 = getelementptr inbounds [100001 x i32], [100001 x i32]* %2, i64 0, i64 0
%32 = load i32, i32* %3
%33 = call i32 @determineMinStrengthFactor(i32* %31, i32 %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %33)
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %8
37: ; preds = %8
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 [100001 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [100001 x 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* %3)
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 1
br i1 %9, label %33, label %10
10: ; preds = %0
%11 = getelementptr inbounds [100001 x i32], [100001 x i32]* %1, i64 0, i64 0
br label %12
12: ; preds = %10, %26
%13 = phi i32 [ 1, %10 ], [ %30, %26 ]
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
store i32 0, i32* %11
%17 = icmp sgt i32 %15, 0
br i1 %17, label %18, label %26
18: ; preds = %12, %18
%19 = phi i64 [ %22, %18 ], [ 1, %12 ]
%20 = getelementptr inbounds [100001 x i32], [100001 x i32]* %1, i64 0, i64 %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
%22 = add nuw nsw i64 %19, 1
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %18, label %26
26: ; preds = %18, %12
%27 = phi i32 [ %16, %12 ], [ %23, %18 ]
%28 = call i32 @determineMinStrengthFactor(i32* %11, i32 %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %28)
%30 = add nuw nsw i32 %13, 1
%31 = load i32, i32* %3
%32 = icmp slt i32 %13, %31
br i1 %32, label %12, label %33
33: ; preds = %26, %0
ret i32 0
}