#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);
int /*<<< orphan*/ scanf(char *, long *, ...);
int main() {
  long int n, a, b, nessy;
  scanf("%ld", &n);
  while (n--) {
    scanf("%ld %d", &a, &b);
    nessy = ((long int)a / 3) * ((long int)b / 3);
    printf("%ld\n", nessy);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     11b4 <main+0x94>
lea    0xea3(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
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    $0x20,%rsp
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subq   $0x1,0x8(%rsp)
jb     11bb <main+0x9b>
lea    0xeb5(%rip),%r14
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%r12
movabs $0x5555555555555556,%rbx
55 55 55
lea    0xea1(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rax
imulq  0x18(%rsp)
mov    %rdx,%rcx
mov    %rbx,%rax
imulq  0x10(%rsp)
mov    %rcx,%rax
shr    $0x3f,%rax
add    %rcx,%rax
mov    %rdx,%rsi
shr    $0x3f,%rsi
add    %rdx,%rsi
imul   %rax,%rsi
mov    %r13,%rdi
call   1030 <printf@plt>
subq   $0x1,0x8(%rsp)
jae    1170 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [7 x i8] c"%ld %d\00"
@.str.2 = [5 x i8] c"%ld\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
%6 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
br label %7
7: ; preds = %11, %0
%8 = load i64, i64* %2
%9 = add nsw i64 %8, -1
store i64 %9, i64* %2
%10 = icmp ne i64 %8, 0
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %3, i64* %4)
%13 = load i64, i64* %3
%14 = sdiv i64 %13, 3
%15 = load i64, i64* %4
%16 = sdiv i64 %15, 3
%17 = mul nsw i64 %14, %16
store i64 %17, i64* %5
%18 = load i64, i64* %5
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %18)
br label %7
20: ; preds = %7
ret i32 0
}

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