#P15930. [TOPC 2021] Aliquot Sum
[TOPC 2021] Aliquot Sum
题目描述
A divisor of a positive integer is an integer where is an integer. In this problem, we define the aliquot sum of a positive integer as the sum of all divisors of other than itself. For examples, , , and .
With the aliquot sum, we can classify positive integers into three types: abundant numbers, deficient numbers, and perfect numbers. The rules are as follows.
- A positive integer is an abundant number if .
- A positive intewer is a deficient number if .
- A positive integer is a perfect number if .
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 indicating the number of test cases. The second line of the input contains space-separated positive integers .
输出格式
Output lines. If is an abundant number, then print abundant on the -th line. If is a deficient number, then print deficient on the -th line. If is a perfect number, then print perfect on the -th line.
3
12 21 28
abundant
deficient
perfect
提示
- for .