#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 *, long long, ...);
int scanf(char *, long long *, long long *);
int main() {
  long long int n, r, temp, i = 1;
  while (scanf("%lld %lld", &r, &n) == 2) {
    if (r == 0 && n == 0)
      break;
    temp = (r - 1) / n;
    if (temp > 26)
      printf("Case %lld: impossible\n", i);
    else
      printf("Case %lld: %lld\n", i, temp);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x28(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11ca <main+0xaa>
cmpq   $0x0,-0x18(%rbp)
jne    116f <main+0x4f>
cmpq   $0x0,-0x10(%rbp)
jne    116f <main+0x4f>
jmp    11ca <main+0xaa>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x20(%rbp)
cmpq   $0x1a,-0x20(%rbp)
jle    11a3 <main+0x83>
mov    -0x28(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1137 <main+0x17>
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    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11f9 <main+0xd9>
mov    $0x1,%ebx
lea    0xeb1(%rip),%r14
lea    0xea0(%rip),%r15
lea    0x8(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xeb0(%rip),%rbp
jmp    11a7 <main+0x87>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11f9 <main+0xd9>
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
je     11f9 <main+0xd9>
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     11e0 <main+0xc0>
cqto
idiv   %rcx
cmp    $0x1b,%rax
jl     1180 <main+0x60>
jmp    11ea <main+0xca>
cs nopw 0x0(%rax,%rax,1)
xor    %edx,%edx
div    %ecx
cmp    $0x1b,%rax
jl     1180 <main+0x60>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1190 <main+0x70>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%lld %lld\00"
@.str.1 = [23 x i8] c"Case %lld: impossible\0A\00"
@.str.2 = [17 x i8] c"Case %lld: %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %5
br label %6
6: ; preds = %30, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %2)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %33
9: ; preds = %6
%10 = load i64, i64* %3
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %33
16: ; preds = %12, %9
%17 = load i64, i64* %3
%18 = sub nsw i64 %17, 1
%19 = load i64, i64* %2
%20 = sdiv i64 %18, %19
store i64 %20, i64* %4
%21 = load i64, i64* %4
%22 = icmp sgt i64 %21, 26
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = load i64, i64* %5
%25 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %24)
br label %30
26: ; preds = %16
%27 = load i64, i64* %5
%28 = load i64, i64* %4
%29 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 %27, i64 %28)
br label %30
30: ; preds = %26, %23
%31 = load i64, i64* %5
%32 = add nsw i64 %31, 1
store i64 %32, i64* %5
br label %6
33: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lld %lld\00"
@.str.1 = [23 x i8] c"Case %lld: impossible\0A\00"
@.str.2 = [17 x i8] c"Case %lld: %lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %1)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %26
7: ; preds = %0, %22
%8 = phi i64 [ %23, %22 ], [ 1, %0 ]
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
%11 = load i64, i64* %1
%12 = icmp eq i64 %11, 0
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %26, label %14
14: ; preds = %7
%15 = add nsw i64 %9, -1
%16 = sdiv i64 %15, %11
%17 = icmp sgt i64 %16, 26
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %8)
br label %22
20: ; preds = %14
%21 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 %8, i64 %16)
br label %22
22: ; preds = %20, %18
%23 = add nuw nsw i64 %8, 1
%24 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %1)
%25 = icmp eq i32 %24, 2
br i1 %25, label %7, label %26
26: ; preds = %22, %7, %0
ret i32 0
}