#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 *, ...);
long double sqrt(long long);
int main(void) {
  int t, fl;
  long long int n = 0, i;
  long double f = 0;
  scanf("%lld", &t);
  while (t--) {
    fl = 0;
    scanf("%d", &n);
    for (i = 1; i < n; i++) {
      f = sqrt(n * n - i * i);
      if ((long int)f == f) {
        fl = 1;
        break;
      }
    }
    if (fl == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
fldz
fstpt  -0x30(%rbp)
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1248 <main+0x118>
movl   $0x0,-0xc(%rbp)
lea    0xe85(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    121c <main+0xec>
mov    -0x18(%rbp),%rdi
imul   %rdi,%rdi
mov    -0x20(%rbp),%rax
imul   %rax,%rax
sub    %rax,%rdi
call   1050 <sqrt@plt>
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fnstcw -0x42(%rbp)
movzwl -0x42(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x44(%rbp)
fldcw  -0x44(%rbp)
fld    %st(0)
fistpll -0x40(%rbp)
fldcw  -0x42(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
fildll -0x38(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jne    1206 <main+0xd6>
jp     1206 <main+0xd6>
jmp    11fa <main+0xca>
movl   $0x1,-0xc(%rbp)
jmp    121c <main+0xec>
jmp    120b <main+0xdb>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1193 <main+0x63>
cmpl   $0x1,-0xc(%rbp)
jne    1237 <main+0x107>
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
jmp    1243 <main+0x113>
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
jmp    115e <main+0x2e>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
movq   $0x0,0x8(%rsp)
lea    0xeb3(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    1170 <main+0x40>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe8e(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xe85(%rip),%r13
lea    0xe81(%rip),%r12
jmp    11a2 <main+0x72>
nopl   0x0(%rax)
mov    %r12,%rax
mov    %rax,%rdi
call   1030 <puts@plt>
subl   $0x1,0x4(%rsp)
jb     1160 <main+0x30>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%rdi
mov    %r13,%rax
cmp    $0x2,%rdi
jl     1193 <main+0x63>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
imul   %rdi,%rdi
mov    %rbx,%rax
imul   %rbx,%rax
sub    %rax,%rdi
call   1050 <sqrt@plt>
fnstcw (%rsp)
movzwl (%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x2(%rsp)
fldcw  0x2(%rsp)
fld    %st(0)
fistpll 0x10(%rsp)
fldcw  (%rsp)
mov    0x10(%rsp),%rax
mov    %rax,0x18(%rsp)
fildll 0x18(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    121d <main+0xed>
jnp    1190 <main+0x60>
add    $0x1,%rbx
mov    0x8(%rsp),%rdi
cmp    %rdi,%rbx
jl     11d0 <main+0xa0>
mov    %r13,%rax
jmp    1193 <main+0x63>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [3 x i8] c"NO\00"
@str.4 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %33, label %9
9: ; preds = %0, %27
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%11 = load i64, i64* %2
%12 = icmp sgt i64 %11, 1
br i1 %12, label %16, label %27
13: ; preds = %16
%14 = load i64, i64* %2
%15 = icmp slt i64 %26, %14
br i1 %15, label %16, label %27
16: ; preds = %9, %13
%17 = phi i64 [ %14, %13 ], [ %11, %9 ]
%18 = phi i64 [ %26, %13 ], [ 1, %9 ]
%19 = mul nsw i64 %17, %17
%20 = mul nsw i64 %18, %18
%21 = sub nsw i64 %19, %20
%22 = call x86_fp80 @sqrt(i64 %21)
%23 = fptosi x86_fp80 %22 to i64
%24 = sitofp i64 %23 to x86_fp80
%25 = fcmp oeq x86_fp80 %22, %24
%26 = add nuw nsw i64 %18, 1
br i1 %25, label %27, label %13
27: ; preds = %13, %16, %9
%28 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %16 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %13 ]
%29 = call i32 @puts(i8* dereferenceable(1) %28)
%30 = load i32, i32* %1
%31 = add nsw i32 %30, -1
store i32 %31, i32* %1
%32 = icmp eq i32 %30, 0
br i1 %32, label %33, label %9
33: ; preds = %27, %0
ret i32 0
}