Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/funksiya-mukammal-sonlar

Is it a perfect number

Easy 2000 ms 128 MB 28%
Share

Write a function IsPerfect(x) that returns true if the positive integer $x$ is perfect and false otherwise. A perfect number equals the sum of its positive divisors smaller than itself.

Example 1: IsPerfect(28) → true — $1 + 2 + 4 + 7 + 14 = 28$.

Example 2: IsPerfect(12) → false — $1 + 2 + 3 + 4 + 6 = 16$.

Write only the function body.

A number goes into the function IsPerfect, which returns true if the number is perfect

Input

One line with a positive integer $x$ — the argument of the function.

Output

The value returned by the function: true or false.

Note

$1 \le x \le 10^{4}$

Examples

Input #1
28
Output #1
true
Input #2
12
Output #2
false

Sign in to submit a solution

Signing up is free and takes a minute.