49. Perfect Number

Acceptance — 0 accepted 0 submissions

Easy
LoopsMath
No companies listed
A number is perfect if it equals the sum of its proper divisors (all divisors except the number itself).

Example: 28 = 1 + 2 + 4 + 7 + 14. Ancient mathematicians loved these rare numbers.
Given n, check whether it is perfect.

Input Format
A single integer n.

Output Format
Print Perfect or Not Perfect.

Constraints
• 1 ≤ n ≤ 10^6

Example 1

Input
28
Output
Perfect

Explanation 1 + 2 + 4 + 7 + 14 = 28.

Example 2

Input
6
Output
Perfect

Explanation 1 + 2 + 3 = 6.

Example 3

Input
12
Output
Not Perfect

Explanation 1 + 2 + 3 + 4 + 6 = 16, not 12.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
Perfect
No results yet
Run your code to test it against the sample cases.
Problem List