Divisor Type

A number can be classified by the sum of its proper divisors — all positive divisors except the number itself. Write a function classify_number that returns perfect if the sum equals n, abundant if the sum is greater than n, and deficient if the sum is smaller. This check helps you understand how a number is built from its divisors.

Примеры

Ввод
6
Вывод
"perfect"
Ввод
12
Вывод
"abundant"
Ввод
8
Вывод
"deficient"

Нужно реализовать

def classify_number(n: int) -> str:

Теги

math
PostgreSQLv16

Aici va apărea rezultatul execuției codului

Visible tests
1
Input
6
Expected"perfect"
2
Input
12
Expected"abundant"
3
Input
8
Expected"deficient"
4
Input
28
Expected"perfect"
5
Input
18
Expected"abundant"
6
Input
1
Expected"deficient"
Focus radio
Paused · SomaFM · Fluid