#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 */
double ceil(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, x = 0;
  double y;
  int i;
  for (i = 0; i < 10002; i++) {
    scanf("%d%d", &a, &b);
    if (a == 0 && b == 0)
      break;
    printf("Case %d: ", i + 1);
    if (a < b) {
      printf("%d\n", x);
    } else {
      if (a > (26 * b) + b) {
        printf("impossible\n");
      } else {
        y = ceil((a - b) / (b - 2.0 + 2));
        printf("%.0lf\n", y);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2712,-0x1c(%rbp)
jge    1246 <main+0x116>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1187 <main+0x57>
cmpl   $0x0,-0xc(%rbp)
jne    1187 <main+0x57>
jmp    1246 <main+0x116>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bd <main+0x8d>
mov    -0x10(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1233 <main+0x103>
mov    -0x8(%rbp),%eax
imul   $0x1a,-0xc(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jle    11e2 <main+0xb2>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    122e <main+0xfe>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe07(%rip),%xmm2
subsd  %xmm2,%xmm1
movsd  0xdfb(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe00(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1233 <main+0x103>
jmp    1238 <main+0x108>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <main+0x1d>
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
push   %rax
mov    $0x1,%ebx
lea    0xeb9(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%r12
lea    0xeaf(%rip),%r13
lea    0xeb2(%rip),%rbp
jmp    118b <main+0x4b>
nop
mov    %rbp,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x2713,%ebx
je     121e <main+0xde>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
or     (%rsp),%eax
je     121e <main+0xde>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%eax
mov    %edx,%ecx
sub    %eax,%ecx
jl     1170 <main+0x30>
lea    (%rax,%rax,8),%esi
lea    (%rsi,%rsi,2),%esi
cmp    %esi,%edx
jle    11e0 <main+0xa0>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
jmp    117c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xe0a(%rip),%xmm1
addsd  0xe0a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <ceil@plt>
lea    0xe11(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    117c <main+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [10 x i8] c"Case %d: \00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [12 x i8] c"impossible\0A\00"
@.str.4 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %6
br label %7
7: ; preds = %53, %0
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 10002
br i1 %9, label %10, label %56
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
br label %56
18: ; preds = %14, %10
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %18
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %52
28: ; preds = %18
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = mul nsw i32 26, %30
%32 = load i32, i32* %3
%33 = add nsw i32 %31, %32
%34 = icmp sgt i32 %29, %33
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %51
37: ; preds = %28
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = sub nsw i32 %38, %39
%41 = sitofp i32 %40 to double
%42 = load i32, i32* %3
%43 = sitofp i32 %42 to double
%44 = fsub double %43, 2.000000e+00
%45 = fadd double %44, 2.000000e+00
%46 = fdiv double %41, %45
%47 = fptosi double %46 to i32
%48 = call double @ceil(i32 %47)
store double %48, double* %5
%49 = load double, double* %5
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %49)
br label %51
51: ; preds = %37, %35
br label %52
52: ; preds = %51, %25
br label %53
53: ; preds = %52
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %7
56: ; preds = %17, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [10 x i8] c"Case %d: \00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.4 = [7 x i8] c"%.0lf\0A\00"
@str = [11 x i8] c"impossible\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %36
%6 = phi i32 [ 0, %0 ], [ %14, %36 ]
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %38, label %13
13: ; preds = %5
%14 = add nuw nsw i32 %6, 1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %36
21: ; preds = %13
%22 = mul nsw i32 %17, 27
%23 = icmp sgt i32 %16, %22
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %36
26: ; preds = %21
%27 = sub nsw i32 %16, %17
%28 = sitofp i32 %27 to double
%29 = sitofp i32 %17 to double
%30 = fadd double %29, -2.000000e+00
%31 = fadd double %30, 2.000000e+00
%32 = fdiv double %28, %31
%33 = fptosi double %32 to i32
%34 = call double @ceil(i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %34)
br label %36
36: ; preds = %19, %26, %24
%37 = icmp eq i32 %14, 10002
br i1 %37, label %38, label %5
38: ; preds = %5, %36
ret i32 0
}