Central Meridian Number

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 2854
64-bit integer IO format: %I64d      Java class name: Main

Description

A Central Meridian (ACM) Number N is a positive integer satisfies that given two positive integers A and B, and among A, B and N, we have
N | ((A^2)*B+1) Then N | (A^2+B)
Now, here is a number x, you need to tell me if it is ACM number or not.

Input

The first line there is a number T (0<T<5000), denoting the test case number.
The following T lines for each line there is a positive number N (0<N<5000) you need to judge.

Output

For each case, output “YES” if the given number is Kitty Number, “NO” if it is not.

Sample Input

2
3
7

Sample Output

YES
NO

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .