Semiperfect
면접 대비시간 제한1초메모리 제한1024 MB
각 정수 m에 대해 진약수의 부분집합 중 합이 m이 되는 것이 있는지 판별한다.
문제
A semiperfect number is a number that all or some of the divisors (not including itself) of the number can be added together to get the original number. For instance, the number 12 has the following applicable divisors: 1, 2, 3, 4, 6. The divisors 6, 4, and 2 can be added together to get 12, therefore 12 is a semiperfect number. Given a number, determine whether or not it is semiperfect.
입력
The first line of input will contain a single integer n that indicates the number of lines to follow. Each line will consist of a single integer m (1 < m < 1000000), which will be the number that you are required to determine to be semiperfect or not semiperfect.
출력
If m is semiperfect print “Semiperfect”, otherwise, print “NOT Semiperfect”.