#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 a, mile, juice;
  int i, j, n, t;
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%d", &n);
    mile = 0, juice = 0;
    for (j = 0; j < n; j++) {
      scanf("%d", &a);
      mile += (a + 30) / 30;
      juice += (a + 60) / 60;
    }
    mile *= 10;
    juice *= 15;
    if (mile < juice) {
      printf("Case %d: Mile %d\n", i, mile);
    } else if (mile > juice) {
      printf("Case %d: Juice %d\n", i, juice);
    } else {
      printf("Case %d: Mile Juice %d\n", i, mile);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1247 <main+0x127>
lea    0xea7(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11c9 <main+0xa9>
lea    0xe76(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1e,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3c,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1177 <main+0x57>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0xf,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11fa <main+0xda>
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
jmp    1234 <main+0x114>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    121d <main+0xfd>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
jmp    122f <main+0x10f>
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdfe(%rip),%rdi
call   1030 <printf@plt>
jmp    1234 <main+0x114>
jmp    1239 <main+0x119>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x26>
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    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    124c <main+0x12c>
mov    $0x1,%r14d
lea    0xea9(%rip),%rbx
lea    0x14(%rsp),%r12
jmp    1181 <main+0x61>
xchg   %ax,%ax
lea    0xe9c(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
lea    0x1(%r14),%eax
cmp    0xc(%rsp),%r14d
mov    %eax,%r14d
jge    124c <main+0x12c>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x10(%rsp)
jle    1210 <main+0xf0>
xor    %r15d,%r15d
xor    %ebp,%ebp
xor    %r13d,%r13d
nopl   (%rax)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
lea    0x1e(%rax),%ecx
movslq %ecx,%rcx
imul   $0xffffffff88888889,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
add    $0x1e,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
add    %ecx,%r13d
mov    %eax,%ecx
add    $0x3c,%ecx
movslq %ecx,%rcx
imul   $0xffffffff88888889,%rcx,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
add    $0x3c,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
add    %eax,%ebp
add    $0x1,%r15d
cmp    0x10(%rsp),%r15d
jl     11a0 <main+0x80>
jmp    1215 <main+0xf5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %r13d,%r13d
xor    %ebp,%ebp
add    %r13d,%r13d
lea    0x0(%r13,%r13,4),%edx
lea    0x0(%rbp,%rbp,4),%eax
lea    (%rax,%rax,2),%eax
cmp    %eax,%edx
jl     1160 <main+0x40>
jle    1240 <main+0x120>
lea    0xde0(%rip),%rdi
mov    %r14d,%esi
mov    %eax,%edx
jmp    116a <main+0x4a>
nop
lea    0xde1(%rip),%rdi
jmp    1167 <main+0x47>
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 = [18 x i8] c"Case %d: Mile %d\0A\00"
@.str.2 = [19 x i8] c"Case %d: Juice %d\0A\00"
@.str.3 = [24 x i8] c"Case %d: Mile Juice %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
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
store i32 1, i32* %5
br label %10
10: ; preds = %61, %0
%11 = load i32, i32* %5
%12 = load i32, i32* %8
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %64
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %6
br label %16
16: ; preds = %32, %14
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %35
20: ; preds = %16
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 30
%24 = sdiv i32 %23, 30
%25 = load i32, i32* %3
%26 = add nsw i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 60
%29 = sdiv i32 %28, 60
%30 = load i32, i32* %4
%31 = add nsw i32 %30, %29
store i32 %31, i32* %4
br label %32
32: ; preds = %20
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %16
35: ; preds = %16
%36 = load i32, i32* %3
%37 = mul nsw i32 %36, 10
store i32 %37, i32* %3
%38 = load i32, i32* %4
%39 = mul nsw i32 %38, 15
store i32 %39, i32* %4
%40 = load i32, i32* %3
%41 = load i32, i32* %4
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %47
43: ; preds = %35
%44 = load i32, i32* %5
%45 = load i32, i32* %3
%46 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %45)
br label %60
47: ; preds = %35
%48 = load i32, i32* %3
%49 = load i32, i32* %4
%50 = icmp sgt i32 %48, %49
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load i32, i32* %5
%53 = load i32, i32* %4
%54 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %52, i32 %53)
br label %59
55: ; preds = %47
%56 = load i32, i32* %5
%57 = load i32, i32* %3
%58 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %56, i32 %57)
br label %59
59: ; preds = %55, %51
br label %60
60: ; preds = %59, %43
br label %61
61: ; preds = %60
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %10
64: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [18 x i8] c"Case %d: Mile %d\0A\00"
@.str.2 = [19 x i8] c"Case %d: Juice %d\0A\00"
@.str.3 = [24 x i8] c"Case %d: Mile Juice %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* %3)
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 1
br i1 %9, label %48, label %10
10: ; preds = %0, %44
%11 = phi i32 [ %45, %44 ], [ 1, %0 ]
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %30
15: ; preds = %10, %15
%16 = phi i32 [ %27, %15 ], [ 0, %10 ]
%17 = phi i32 [ %26, %15 ], [ 0, %10 ]
%18 = phi i32 [ %23, %15 ], [ 0, %10 ]
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 30
%22 = sdiv i32 %21, 30
%23 = add nsw i32 %22, %18
%24 = add nsw i32 %20, 60
%25 = sdiv i32 %24, 60
%26 = add nsw i32 %25, %17
%27 = add nuw nsw i32 %16, 1
%28 = load i32, i32* %2
%29 = icmp slt i32 %27, %28
br i1 %29, label %15, label %30
30: ; preds = %15, %10
%31 = phi i32 [ 0, %10 ], [ %23, %15 ]
%32 = phi i32 [ 0, %10 ], [ %26, %15 ]
%33 = mul nsw i32 %31, 10
%34 = mul nsw i32 %32, 15
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %33)
br label %44
38: ; preds = %30
%39 = icmp sgt i32 %33, %34
br i1 %39, label %40, label %42
40: ; preds = %38
%41 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %34)
br label %44
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %33)
br label %44
44: ; preds = %36, %42, %40
%45 = add nuw nsw i32 %11, 1
%46 = load i32, i32* %3
%47 = icmp slt i32 %11, %46
br i1 %47, label %10, label %48
48: ; preds = %44, %0
ret i32 0
}