The Quest for Perfection

2.8

5 votes
Easy, Math, Simple-math
Problem

Atanu is a man who always strives for perfection and today sworn to write a program which checks if a number if perfect or not.

Can you be as perfect as Atanu?

Definition of Perfect number:
A perfect number is a positive integer that is equal to the sum of its proper positive divisors excluding the number itself. By this definition, 1 is not a perfect number.

Input Format
The first line contains a single integer T denoting the number of testcases. Next T lines contains a single integer each.

Output Format
For each test case print the yes or no on a single line.

Constraint
1 ≤ T ≤ 105
0 ≤ x ≤ 1,000,000,000

Note Please consider 0 as perfect number and print Yes.

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

Take number 6. Proper positive divisors of 6 is 1,2,3 and their sum is 1+2+3=6. So, 6 is a perfect number. Similarly, 2 is not a perfect number.

Editor Image

?