#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 */
float ceil(float);
int /*<<< orphan*/ printf(char *, int, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t, i, j, n, time;
  float mi, ju;
  float mile, juice;
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    mi = 0;
    ju = 0;
    scanf("%d", &n);
    mile = 0, juice = 0;
    for (j = 0; j < n; j++) {
      scanf("%d", &time);
      mile = (time / 30.0);
      if (time % 30 == 0 && time >= 30)
        mile += 1;
      mile = ceil(mile);
      mi += (mile * 10.0);
      juice = (time / 60.0);
      if (time % 60 == 0 && time >= 60)
        juice += 1;
      juice = ceil(juice);
      ju += (juice * 15.0);
    }
    if (ju == mi)
      printf("Case %d: Mile Juice %.0f\n", i, ju);
    else if (ju < mi)
      printf("Case %d: Juice %.0f\n", i, ju);
    else
      printf("Case %d: Mile %.0f\n", i, mi);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1351 <main+0x221>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xeab(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12cb <main+0x19b>
lea    0xe78(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xe3e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ff <main+0xcf>
cmpl   $0x1e,-0x18(%rbp)
jl     11ff <main+0xcf>
movss  0xe2b(%rip),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xde8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xdc2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1283 <main+0x153>
cmpl   $0x3c,-0x18(%rbp)
jl     1283 <main+0x153>
movss  0xda7(%rip),%xmm0
addss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xd6c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1199 <main+0x69>
movss  -0x20(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jne    12f9 <main+0x1c9>
jp     12f9 <main+0x1c9>
mov    -0xc(%rbp),%esi
movss  -0x20(%rbp),%xmm0
lea    0xd38(%rip),%rdi
call   1040 <printf@plt>
jmp    133e <main+0x20e>
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1325 <main+0x1f5>
mov    -0xc(%rbp),%esi
movss  -0x20(%rbp),%xmm0
lea    0xd26(%rip),%rdi
call   1040 <printf@plt>
jmp    1339 <main+0x209>
mov    -0xc(%rbp),%esi
movss  -0x1c(%rbp),%xmm0
lea    0xd22(%rip),%rdi
call   1040 <printf@plt>
jmp    133e <main+0x20e>
jmp    1343 <main+0x213>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xedf(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x14(%rsp)
jle    12f4 <main+0x1c4>
mov    $0x1,%r14d
lea    0xebd(%rip),%rbx
lea    0x1c(%rsp),%r12
jmp    1194 <main+0x64>
xchg   %ax,%ax
xorps  %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
lea    0x1(%r14),%eax
cmp    0x14(%rsp),%r14d
mov    %eax,%r14d
jge    12f4 <main+0x1c4>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x10(%rsp)
jle    1170 <main+0x40>
xor    %ebp,%ebp
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm1,0xc(%rsp)
jmp    1205 <main+0xd5>
nopl   0x0(%rax,%rax,1)
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0xc(%rsp)
call   1040 <ceilf@plt>
cvtss2sd %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xe28(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x1,%ebp
cmp    0x10(%rsp),%ebp
jge    12c0 <main+0x190>
movss  %xmm0,0x18(%rsp)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0x1c(%rsp),%r13d
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x20(%rsp)
divsd  0xdcf(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
imul   $0xeeeeeeef,%r13d,%r15d
add    $0x8888888,%r15d
mov    %r15d,%eax
ror    %eax
movaps %xmm1,%xmm0
cmp    $0x8888889,%eax
jae    125d <main+0x12d>
addss  0xdc3(%rip),%xmm0
cmp    $0x1e,%r13d
jge    1266 <main+0x136>
movaps %xmm1,%xmm0
call   1040 <ceilf@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
divsd  0xd90(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
mulsd  0xd79(%rip),%xmm1
ror    $0x2,%r15d
movaps %xmm2,%xmm0
cmp    $0x4444445,%r15d
jae    12a7 <main+0x177>
addss  0xd79(%rip),%xmm0
movss  0xc(%rsp),%xmm3
cmp    $0x3c,%r13d
jge    11c0 <main+0x90>
movaps %xmm2,%xmm0
jmp    11c0 <main+0x90>
nop
movss  0xc(%rsp),%xmm1
ucomiss %xmm1,%xmm0
jne    12d1 <main+0x1a1>
jnp    1173 <main+0x43>
ucomiss %xmm0,%xmm1
jbe    12e2 <main+0x1b2>
lea    0xd64(%rip),%rdi
jmp    117a <main+0x4a>
lea    0xd6d(%rip),%rdi
mov    %r14d,%esi
movaps %xmm1,%xmm0
jmp    117d <main+0x4d>
xor    %eax,%eax
add    $0x28,%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 = [26 x i8] c"Case %d: Mile Juice %.0f\0A\00"
@.str.2 = [21 x i8] c"Case %d: Juice %.0f\0A\00"
@.str.3 = [20 x i8] c"Case %d: Mile %.0f\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 float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 0, i32* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %12
12: ; preds = %93, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %96
16: ; preds = %12
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store float 0.000000e+00, float* %9
store float 0.000000e+00, float* %10
store i32 0, i32* %4
br label %18
18: ; preds = %68, %16
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %71
22: ; preds = %18
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%24 = load i32, i32* %6
%25 = sitofp i32 %24 to double
%26 = fdiv double %25, 3.000000e+01
%27 = fptrunc double %26 to float
store float %27, float* %9
%28 = load i32, i32* %6
%29 = srem i32 %28, 30
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %22
%32 = load i32, i32* %6
%33 = icmp sge i32 %32, 30
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load float, float* %9
%36 = fadd float %35, 1.000000e+00
store float %36, float* %9
br label %37
37: ; preds = %34, %31, %22
%38 = load float, float* %9
%39 = call float @ceil(float %38)
store float %39, float* %9
%40 = load float, float* %9
%41 = fpext float %40 to double
%42 = load float, float* %7
%43 = fpext float %42 to double
%44 = call double @llvm.fmuladd.f64(double %41, double 1.000000e+01, double %43)
%45 = fptrunc double %44 to float
store float %45, float* %7
%46 = load i32, i32* %6
%47 = sitofp i32 %46 to double
%48 = fdiv double %47, 6.000000e+01
%49 = fptrunc double %48 to float
store float %49, float* %10
%50 = load i32, i32* %6
%51 = srem i32 %50, 60
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %59
53: ; preds = %37
%54 = load i32, i32* %6
%55 = icmp sge i32 %54, 60
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load float, float* %10
%58 = fadd float %57, 1.000000e+00
store float %58, float* %10
br label %59
59: ; preds = %56, %53, %37
%60 = load float, float* %10
%61 = call float @ceil(float %60)
store float %61, float* %10
%62 = load float, float* %10
%63 = fpext float %62 to double
%64 = load float, float* %8
%65 = fpext float %64 to double
%66 = call double @llvm.fmuladd.f64(double %63, double 1.500000e+01, double %65)
%67 = fptrunc double %66 to float
store float %67, float* %8
br label %68
68: ; preds = %59
%69 = load i32, i32* %4
%70 = add nsw i32 %69, 1
store i32 %70, i32* %4
br label %18
71: ; preds = %18
%72 = load float, float* %8
%73 = load float, float* %7
%74 = fcmp oeq float %72, %73
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i32, i32* %3
%77 = load float, float* %8
%78 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %76, float %77)
br label %92
79: ; preds = %71
%80 = load float, float* %8
%81 = load float, float* %7
%82 = fcmp olt float %80, %81
br i1 %82, label %83, label %87
83: ; preds = %79
%84 = load i32, i32* %3
%85 = load float, float* %8
%86 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %84, float %85)
br label %91
87: ; preds = %79
%88 = load i32, i32* %3
%89 = load float, float* %7
%90 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %88, float %89)
br label %91
91: ; preds = %87, %83
br label %92
92: ; preds = %91, %75
br label %93
93: ; preds = %92
%94 = load i32, i32* %3
%95 = add nsw i32 %94, 1
store i32 %95, i32* %3
br label %12
96: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"Case %d: Mile Juice %.0f\0A\00"
@.str.2 = [21 x i8] c"Case %d: Juice %.0f\0A\00"
@.str.3 = [20 x i8] c"Case %d: Mile %.0f\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 slt i32 %8, 1
br i1 %9, label %66, label %10
10: ; preds = %0, %62
%11 = phi i32 [ %63, %62 ], [ 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 %53
15: ; preds = %10, %15
%16 = phi float [ %47, %15 ], [ 0.000000e+00, %10 ]
%17 = phi float [ %34, %15 ], [ 0.000000e+00, %10 ]
%18 = phi i32 [ %48, %15 ], [ 0, %10 ]
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = fdiv double %21, 3.000000e+01
%23 = fptrunc double %22 to float
%24 = srem i32 %20, 30
%25 = icmp eq i32 %24, 0
%26 = icmp sgt i32 %20, 29
%27 = and i1 %26, %25
%28 = fadd float %23, 1.000000e+00
%29 = select i1 %27, float %28, float %23
%30 = call float @llvm.ceil.f32(float %29)
%31 = fpext float %30 to double
%32 = fpext float %17 to double
%33 = call double @llvm.fmuladd.f64(double %31, double 1.000000e+01, double %32)
%34 = fptrunc double %33 to float
%35 = fdiv double %21, 6.000000e+01
%36 = fptrunc double %35 to float
%37 = srem i32 %20, 60
%38 = icmp eq i32 %37, 0
%39 = icmp sgt i32 %20, 59
%40 = and i1 %39, %38
%41 = fadd float %36, 1.000000e+00
%42 = select i1 %40, float %41, float %36
%43 = call float @llvm.ceil.f32(float %42)
%44 = fpext float %43 to double
%45 = fpext float %16 to double
%46 = call double @llvm.fmuladd.f64(double %44, double 1.500000e+01, double %45)
%47 = fptrunc double %46 to float
%48 = add nuw nsw i32 %18, 1
%49 = load i32, i32* %2
%50 = icmp slt i32 %48, %49
br i1 %50, label %15, label %51
51: ; preds = %15
%52 = fcmp oeq float %47, %34
br i1 %52, label %53, label %56
53: ; preds = %10, %51
%54 = phi float [ %47, %51 ], [ 0.000000e+00, %10 ]
%55 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %11, float %54)
br label %62
56: ; preds = %51
%57 = fcmp olt float %47, %34
br i1 %57, label %58, label %60
58: ; preds = %56
%59 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %11, float %47)
br label %62
60: ; preds = %56
%61 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %11, float %34)
br label %62
62: ; preds = %53, %60, %58
%63 = add nuw nsw i32 %11, 1
%64 = load i32, i32* %1
%65 = icmp slt i32 %11, %64
br i1 %65, label %10, label %66
66: ; preds = %62, %0
ret i32 0
}