#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 num_cases;
  int a, b;
  int n, m;
  int i;
  scanf("%d\n", &num_cases);
  for (i = 1; i <= num_cases; i++) {
    scanf("%d\n", &a);
    scanf("%d\n", &b);
    a = (a & 0x1) ? a : a + 1;
    b = (b & 0x1) ? b : b - 1;
    if (a <= b) {
      n = a / 2;
      m = b / 2;
      printf("Case %d: %d\n", i, (m + n + 1) * (m - n + 1));
    } else {
      printf("Case %d: %d\n", i, 0);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1239 <main+0x119>
lea    0xeb0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     118c <main+0x6c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1195 <main+0x75>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11b5 <main+0x95>
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11be <main+0x9e>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1215 <main+0xf5>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
add    -0x14(%rbp),%edx
add    $0x1,%edx
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x1,%eax
imul   %eax,%edx
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <main+0x106>
mov    -0x1c(%rbp),%esi
lea    0xde1(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
jmp    122b <main+0x10b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11e6 <main+0xc6>
mov    $0x1,%ebx
lea    0xeb4(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%r12
lea    0xe9a(%rip),%r13
jmp    1185 <main+0x65>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
mov    %eax,%ebx
jge    11e6 <main+0xc6>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,%eax
not    %eax
and    $0x1,%eax
add    %ecx,%eax
mov    %eax,0x8(%rsp)
mov    0x4(%rsp),%ecx
mov    %ecx,%edx
and    $0x1,%edx
add    %edx,%ecx
add    $0xffffffff,%ecx
mov    %ecx,0x4(%rsp)
xor    %edx,%edx
cmp    %ecx,%eax
jg     1170 <main+0x50>
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
lea    (%rsi,%rdx,1),%eax
add    $0x1,%eax
sub    %esi,%edx
add    $0x1,%edx
imul   %eax,%edx
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"Case %d: %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
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %7
br label %9
9: ; preds = %59, %0
%10 = load i32, i32* %7
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %62
13: ; preds = %9
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %4)
%16 = load i32, i32* %3
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i32, i32* %3
br label %24
21: ; preds = %13
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
br label %24
24: ; preds = %21, %19
%25 = phi i32 [ %20, %19 ], [ %23, %21 ]
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = and i32 %26, 1
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = load i32, i32* %4
br label %34
31: ; preds = %24
%32 = load i32, i32* %4
%33 = sub nsw i32 %32, 1
br label %34
34: ; preds = %31, %29
%35 = phi i32 [ %30, %29 ], [ %33, %31 ]
store i32 %35, i32* %4
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = icmp sle i32 %36, %37
br i1 %38, label %39, label %55
39: ; preds = %34
%40 = load i32, i32* %3
%41 = sdiv i32 %40, 2
store i32 %41, i32* %5
%42 = load i32, i32* %4
%43 = sdiv i32 %42, 2
store i32 %43, i32* %6
%44 = load i32, i32* %7
%45 = load i32, i32* %6
%46 = load i32, i32* %5
%47 = add nsw i32 %45, %46
%48 = add nsw i32 %47, 1
%49 = load i32, i32* %6
%50 = load i32, i32* %5
%51 = sub nsw i32 %49, %50
%52 = add nsw i32 %51, 1
%53 = mul nsw i32 %48, %52
%54 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %53)
br label %58
55: ; preds = %34
%56 = load i32, i32* %7
%57 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %56, i32 0)
br label %58
58: ; preds = %55, %39
br label %59
59: ; preds = %58
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %9
62: ; preds = %9
ret i32 0
}

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