407167: GYM102697 138 Perfect Numbers
Description
A number is considered a perfect number if and only if the sum of its divisors, except for the number itself, is equal to the original number. For example, 28 is a perfect number because its divisors are $$$1$$$, $$$2$$$, $$$4$$$, $$$7$$$, and $$$14$$$, and $$$1$$$ + $$$2$$$ + $$$4$$$ + $$$7$$$ + $$$14$$$ = $$$28$$$.
Given an integer $$$n$$$, figure out whether or not it is a perfect number, and what the sum of its divisors (except for $$$n$$$) is.
InputThe only line of input consists of a single integer $$$n$$$.
OutputOutput two lines.
On the first line, output "PERFECT NUMBER" (no quotes) if the number is a perfect number, and "NOT A PERFECT NUMBER" (no quotes) if the number is not a perfect number. On the second line, output the sum of divisors of the number.
ExamplesInput28Output
PERFECT NUMBER 28Input
48Output
NOT A PERFECT NUMBER 76Note
All numbers used in calculations are guaranteed to fit inside of a Java "int" data type.