#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 EOF;
scalar_t__ pow(unsigned long long, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, unsigned long long *);
unsigned long long sqrt(scalar_t__);
int main() {
  unsigned long long N, T;
  scanf("%Lu", &T);
  while (T--) {
    unsigned long long a, b, c;
    scanf("%Lu", &N);
    if (N % 3 == 0 && N % 4 == 0) {
      b = (N / 3);
      a = (N / 4);
      c = sqrt(pow(a, 2) + pow(b, 2));
      printf("%Lu\n", a * b * c);
    } else
      printf("%d\n", EOF);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     123b <main+0xfb>
lea    0xe81(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1221 <main+0xe1>
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
jne    1221 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    -0x38(%rbp),%rdi
add    %rax,%rdi
call   1060 <sqrt@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
imul   -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
jmp    1236 <main+0xf6>
mov    0x2dc0(%rip),%rax
mov    (%rax),%esi
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x1f>
xor    %eax,%eax
add    $0x40,%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    0xeab(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
subq   $0x1,0x8(%rsp)
jae    1178 <main+0x38>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe81(%rip),%r14
lea    0x10(%rsp),%r13
movabs $0xaaaaaaaaaaaaaaab,%r12
aa aa aa
jmp    11ad <main+0x6d>
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
subq   $0x1,0x8(%rsp)
jb     1167 <main+0x27>
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%rbx
mov    %rbx,%rax
mul    %r12
mov    %rdx,%rbp
shr    %rbp
lea    0x0(,%rbp,2),%rax
add    %rbp,%rax
mov    %rbx,%rcx
sub    %rax,%rcx
mov    %ebx,%eax
and    $0x3,%eax
or     %rcx,%rax
jne    1190 <main+0x50>
shr    $0x2,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    %rax,%r15
mov    %rbp,%rdi
mov    $0x2,%esi
call   1050 <pow@plt>
add    %rax,%r15
mov    %r15,%rdi
call   1060 <sqrt@plt>
imul   %ebp,%ebx
imul   %eax,%ebx
lea    0xde7(%rip),%rdi
mov    %ebx,%esi
jmp    11a0 <main+0x60>

LLVM IR (-O0):
@.str = [4 x i8] c"%Lu\00"
@.str.1 = [5 x i8] c"%Lu\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
br label %8
8: ; preds = %42, %0
%9 = load i64, i64* %3
%10 = add i64 %9, -1
store i64 %10, i64* %3
%11 = icmp ne i64 %9, 0
br i1 %11, label %12, label %43
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%14 = load i64, i64* %2
%15 = urem i64 %14, 3
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %39
17: ; preds = %12
%18 = load i64, i64* %2
%19 = urem i64 %18, 4
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %39
21: ; preds = %17
%22 = load i64, i64* %2
%23 = udiv i64 %22, 3
store i64 %23, i64* %5
%24 = load i64, i64* %2
%25 = udiv i64 %24, 4
store i64 %25, i64* %4
%26 = load i64, i64* %4
%27 = call i64 @pow(i64 %26, i32 2)
%28 = load i64, i64* %5
%29 = call i64 @pow(i64 %28, i32 2)
%30 = add nsw i64 %27, %29
%31 = call i64 @sqrt(i64 %30)
store i64 %31, i64* %6
%32 = load i64, i64* %4
%33 = load i64, i64* %5
%34 = mul i64 %32, %33
%35 = load i64, i64* %6
%36 = mul i64 %34, %35
%37 = trunc i64 %36 to i32
%38 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %37)
br label %42
39: ; preds = %17, %12
%40 = load i32, i32* @EOF
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %21
br label %8
43: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%Lu\00"
@.str.1 = [5 x i8] c"%Lu\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = add i64 %6, -1
store i64 %7, i64* %2
%8 = icmp eq i64 %6, 0
br i1 %8, label %34, label %9
9: ; preds = %0, %30
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%11 = load i64, i64* %1
%12 = urem i64 %11, 3
%13 = udiv i64 %11, 3
%14 = and i64 %11, 3
%15 = or i64 %12, %14
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %27
17: ; preds = %9
%18 = lshr i64 %11, 2
%19 = call i64 @pow(i64 %18, i32 2)
%20 = call i64 @pow(i64 %13, i32 2)
%21 = add nsw i64 %20, %19
%22 = call i64 @sqrt(i64 %21)
%23 = mul i64 %18, %13
%24 = mul i64 %23, %22
%25 = trunc i64 %24 to i32
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %30
27: ; preds = %9
%28 = load i32, i32* @EOF
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %17
%31 = load i64, i64* %2
%32 = add i64 %31, -1
store i64 %32, i64* %2
%33 = icmp eq i64 %31, 0
br i1 %33, label %34, label %9
34: ; preds = %30, %0
ret i32 0
}