아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Semiperfect

면접 대비

시간 제한1초메모리 제한1024 MB

요약
각 정수 m에 대해 진약수의 부분집합 중 합이 m이 되는 것이 있는지 판별한다.
난이도

보통10점 중 5점

유형
동적 계획법, 정수론, 수학
정답자
아직 제출이 없습니다

문제

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”.

예제1

  1. 예제 1

    입력
    4
    3
    6
    32
    228
    
    예상 출력
    NOT Semiperfect
    Semiperfect
    NOT Semiperfect
    Semiperfect