#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 /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int x, y, number, temp;
  scanf("%d", &temp);
  while (temp--) {
    scanf("%d%d", &x, &y);
    if (x == y) {
      if (x == 1 || x == 0)
        number = x;
      if (x % 2 == 0) {
        number = (x - 2) / 2;
        number *= 4;
        number += 4;
      } else {
        number = (x - 3) / 2;
        number *= 4;
        number += 5;
      }
      printf("%d\n", number);
    } else if (x - y == 2) {
      if (x % 2 == 0) {
        number = (x - 2) / 2;
        number *= 4;
        number += 2;
      } else {
        number = (x - 3) / 2;
        number *= 4;
        number += 3;
      }
      printf("%d\n", number);
    } else
      printf("No Number\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     12a2 <main+0x182>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1206 <main+0xe6>
cmpl   $0x1,-0x8(%rbp)
je     118b <main+0x6b>
cmpl   $0x0,-0x8(%rbp)
jne    1191 <main+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11cd <main+0xad>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    11f0 <main+0xd0>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129d <main+0x17d>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x2,%eax
jne    128a <main+0x16a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1251 <main+0x131>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1274 <main+0x154>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1298 <main+0x178>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129d <main+0x17d>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    1167 <main+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe92(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%rbx
lea    0xe86(%rip),%r12
lea    0xe83(%rip),%r13
jmp    11c2 <main+0x92>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ecx
and    $0x1,%ecx
cmp    $0x1,%ecx
adc    $0x0,%eax
mov    %eax,%edx
add    $0xfffffffd,%edx
shr    $0x1f,%edx
add    %edx,%eax
add    $0xfffffffd,%eax
and    $0xfffffffe,%eax
lea    (%rcx,%rax,2),%esi
add    $0x4,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
subl   $0x1,0x4(%rsp)
jb     1157 <main+0x27>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%ecx
sub    0x8(%rsp),%ecx
je     1190 <main+0x60>
cmp    $0x2,%ecx
jne    1210 <main+0xe0>
mov    %eax,%ecx
and    $0x1,%ecx
cmp    $0x1,%ecx
adc    $0x0,%eax
mov    %eax,%edx
add    $0xfffffffd,%edx
shr    $0x1f,%edx
add    %edx,%eax
add    $0xfffffffd,%eax
lea    (%rcx,%rax,2),%esi
or     $0x2,%esi
jmp    11b1 <main+0x81>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
call   1030 <puts@plt>
subl   $0x1,0x4(%rsp)
jae    11c2 <main+0x92>
jmp    1157 <main+0x27>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [11 x i8] c"No Number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
br label %7
7: ; preds = %78, %0
%8 = load i32, i32* %5
%9 = add nsw i32 %8, -1
store i32 %9, i32* %5
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %79
11: ; preds = %7
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %47
16: ; preds = %11
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19, %16
%23 = load i32, i32* %2
store i32 %23, i32* %4
br label %24
24: ; preds = %22, %19
%25 = load i32, i32* %2
%26 = srem i32 %25, 2
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load i32, i32* %2
%30 = sub nsw i32 %29, 2
%31 = sdiv i32 %30, 2
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = mul nsw i32 %32, 4
store i32 %33, i32* %4
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 4
store i32 %35, i32* %4
br label %44
36: ; preds = %24
%37 = load i32, i32* %2
%38 = sub nsw i32 %37, 3
%39 = sdiv i32 %38, 2
store i32 %39, i32* %4
%40 = load i32, i32* %4
%41 = mul nsw i32 %40, 4
store i32 %41, i32* %4
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 5
store i32 %43, i32* %4
br label %44
44: ; preds = %36, %28
%45 = load i32, i32* %4
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %45)
br label %78
47: ; preds = %11
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = sub nsw i32 %48, %49
%51 = icmp eq i32 %50, 2
br i1 %51, label %52, label %75
52: ; preds = %47
%53 = load i32, i32* %2
%54 = srem i32 %53, 2
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %64
56: ; preds = %52
%57 = load i32, i32* %2
%58 = sub nsw i32 %57, 2
%59 = sdiv i32 %58, 2
store i32 %59, i32* %4
%60 = load i32, i32* %4
%61 = mul nsw i32 %60, 4
store i32 %61, i32* %4
%62 = load i32, i32* %4
%63 = add nsw i32 %62, 2
store i32 %63, i32* %4
br label %72
64: ; preds = %52
%65 = load i32, i32* %2
%66 = sub nsw i32 %65, 3
%67 = sdiv i32 %66, 2
store i32 %67, i32* %4
%68 = load i32, i32* %4
%69 = mul nsw i32 %68, 4
store i32 %69, i32* %4
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 3
store i32 %71, i32* %4
br label %72
72: ; preds = %64, %56
%73 = load i32, i32* %4
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %73)
br label %77
75: ; preds = %47
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %77
77: ; preds = %75, %72
br label %78
78: ; preds = %77, %44
br label %7
79: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [10 x i8] c"No Number\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 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = icmp eq i32 %8, 0
br i1 %10, label %45, label %11
11: ; preds = %0, %41
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %11
%17 = and i32 %13, 1
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i32 -2, i32 -3
%20 = or i32 %17, 4
%21 = add nsw i32 %13, %19
%22 = sdiv i32 %21, 2
%23 = shl nsw i32 %22, 2
%24 = add nsw i32 %23, %20
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %41
26: ; preds = %11
%27 = sub nsw i32 %13, %14
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %39
29: ; preds = %26
%30 = and i32 %13, 1
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i32 -2, i32 -3
%33 = or i32 %30, 2
%34 = add nsw i32 %13, %32
%35 = sdiv i32 %34, 2
%36 = shl nsw i32 %35, 2
%37 = or i32 %36, %33
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %41
39: ; preds = %26
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %41
41: ; preds = %29, %39, %16
%42 = load i32, i32* %3
%43 = add nsw i32 %42, -1
store i32 %43, i32* %3
%44 = icmp eq i32 %42, 0
br i1 %44, label %45, label %11
45: ; preds = %41, %0
ret i32 0
}