Given a number N, check if a number is perfect or not. A number is said to be perfect if sum of all its factors excluding the number itself is equal to the number.
First line consists of T test cases. Then T test cases follow .Each test case consists of a number N.
For each testcase, in a new line, output in a single line 1 if a number is a perfect number else print 0.
1 <= T <= 300
1 <= N <= 1018
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.