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

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

Aliquot Sum

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

요약
최대 100만 개의 수(각 100만 이하)에 대해 진약수의 합과 자기 자신을 비교해 abundant, deficient, perfect로 분류한다.
난이도

보통10점 중 4점

유형
수학, 정수론, 완전 탐색
정답자
아직 제출이 없습니다

문제

A divisor of a positive integer n is an integer d where m = n d is an integer. In this problem, we define the aliquot sum s(n) of a positive integer n as the sum of all divisors of n other than n itself. For examples, s(12) = 1 + 2 + 3 + 4 + 6 = 16, s(21) = 1 + 3 + 7 = 11, and s(28) = 1 + 2 + 4 + 7 + 14 = 28.

With the aliquot sum, we can classify positive integers into three types: abundant numbers, deficient numbers, and perfect numbers. The rules are as follows.

  1. A positive integer x is an abundant number if s(x) > x.
  2. A positive intewer y is a deficient number if s(y) < y.
  3. A positive integer z is a perfect number if s(z) = z.

You are given a list of positive integers. Please write a program to classify them.

입력

The first line of the input contains one positive integer T indicating the number of test cases. The second line of the input contains T space-separated positive integers n1, ..., nT.

출력

Output T lines. If ni is an abundant number, then print abundant on the i-th line. If ni is a deficient number, then print deficient on the i-th line. If ni is a perfect number, then print perfect on the i-th line.

제한

  • 1 ≤ T ≤ 106
  • 1 ≤ ni ≤ 106 for i ∈ {1, 2, ..., T}.

예제1

  1. 예제 1

    입력
    3
    12 21 28
    
    예상 출력
    abundant
    deficient
    perfect