Deficient, Perfect, and Abundant | 프로그래밍의 벗 PivotOJ
PivotOJ

Deficient, Perfect, and Abundant

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 1996BOJ 6975

문제

Write a program that repeatedly reads a positive integer, determines if the integer is deficient, perfect, or abundant, and outputs the number along with its classification.

A positive integer, n, is said to be perfect if the sum of its proper divisors equals the number itself. (Proper divisors include 1 but not the number itself.) If this sum is less that n, the number is deficient, and if the sum is greater than n, the number is abundant.

입력

The input starts with the number of integers that follow. For each of the following integers, your program should output the classification, as given below. You may assume that the input integers are greater than 1 and less than 32500.

예제

예제 1

입력
3
4
6
12
출력
4 is a deficient number.

6 is a perfect number.

12 is an abundant number.
코드를 제출하려면 로그인하세요.