#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 /*<<< orphan*/ scanf(char *, ...);
int main() {
  int T, t;
  double n1, n2, n3;
  scanf("%d", &T);
  for (t = 0; t < T; t++) {
    scanf("%lf %lf %lf", &n1, &n2, &n3);
    if (n3 - n2 == n2 - n1 && n3 / n2 == n2 / n1)
      printf("Case %d: Both\n", t + 1);
    else if (n3 - n2 == n2 - n1)
      printf("Case %d: Arithmetic Progression\n", t + 1);
    else if (n3 / n2 == n2 / n1)
      printf("Case %d: Geometric Progression\n", t + 1);
    else
      printf("Case %d: None\n", t + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1272 <main+0x152>
lea    0xea8(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    11cd <main+0xad>
jp     11cd <main+0xad>
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    11cd <main+0xad>
jp     11cd <main+0xad>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
jmp    125f <main+0x13f>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1208 <main+0xe8>
jp     1208 <main+0xe8>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
jmp    125a <main+0x13a>
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1243 <main+0x123>
jp     1243 <main+0x123>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    1255 <main+0x135>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
jmp    125a <main+0x13a>
jmp    125f <main+0x13f>
jmp    1264 <main+0x144>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
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    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11fb <main+0xdb>
lea    0x10(%rsp),%r13
lea    0xec6(%rip),%rbx
lea    0xeb0(%rip),%r14
lea    0xef9(%rip),%r15
lea    0xed2(%rip),%r12
xor    %ebp,%ebp
nop
lea    0xe8c(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movsd  0x20(%rsp),%xmm3
movapd %xmm1,%xmm4
subsd  %xmm3,%xmm4
unpcklpd %xmm1,%xmm0
unpcklpd %xmm3,%xmm1
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
add    $0x1,%ebp
ucomisd %xmm1,%xmm0
mov    %r14,%rdi
cmovne %rbx,%rdi
cmovp  %rbx,%rdi
mov    %r12,%rax
cmovne %r15,%rax
cmovp  %r15,%rax
ucomisd %xmm4,%xmm2
cmovne %rax,%rdi
cmovp  %rax,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    0xc(%rsp),%ebp
jl     1170 <main+0x50>
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 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [15 x i8] c"Case %d: Both\0A\00"
@.str.3 = [33 x i8] c"Case %d: Arithmetic Progression\0A\00"
@.str.4 = [32 x i8] c"Case %d: Geometric Progression\0A\00"
@.str.5 = [15 x i8] c"Case %d: None\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca 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* %2)
store i32 0, i32* %3
br label %8
8: ; preds = %64, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %67
12: ; preds = %8
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5, double* %6)
%14 = load double, double* %6
%15 = load double, double* %5
%16 = fsub double %14, %15
%17 = load double, double* %5
%18 = load double, double* %4
%19 = fsub double %17, %18
%20 = fcmp oeq double %16, %19
br i1 %20, label %21, label %33
21: ; preds = %12
%22 = load double, double* %6
%23 = load double, double* %5
%24 = fdiv double %22, %23
%25 = load double, double* %5
%26 = load double, double* %4
%27 = fdiv double %25, %26
%28 = fcmp oeq double %24, %27
br i1 %28, label %29, label %33
29: ; preds = %21
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
%32 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %63
33: ; preds = %21, %12
%34 = load double, double* %6
%35 = load double, double* %5
%36 = fsub double %34, %35
%37 = load double, double* %5
%38 = load double, double* %4
%39 = fsub double %37, %38
%40 = fcmp oeq double %36, %39
br i1 %40, label %41, label %45
41: ; preds = %33
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
%44 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %43)
br label %62
45: ; preds = %33
%46 = load double, double* %6
%47 = load double, double* %5
%48 = fdiv double %46, %47
%49 = load double, double* %5
%50 = load double, double* %4
%51 = fdiv double %49, %50
%52 = fcmp oeq double %48, %51
br i1 %52, label %53, label %57
53: ; preds = %45
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
%56 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %55)
br label %61
57: ; preds = %45
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
%60 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %57, %53
br label %62
62: ; preds = %61, %41
br label %63
63: ; preds = %62, %29
br label %64
64: ; preds = %63
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
br label %8
67: ; preds = %8
ret i32 0
}

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