Logo
(追記) (追記ここまで)

23335번 - Aliquot Sum 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 1024 MB52718213733.092%

문제

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

3
12 21 28

예제 출력 1

abundant
deficient
perfect

힌트

출처

ICPC > Regionals > Asia Pacific > Taiwan > Taiwan Online Programming Contest > TOPC 2021 B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /