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

~/algor $ cat problems/while-narsissistik-son

Narcissistic number

Easy 1000 ms 64 MB 31%
Share

A $k$-digit positive integer $n$ is given. If the sum of the $k$-th powers of its digits equals $n$ itself, print true, otherwise false.

Raising each digit of the number to a power and comparing the sum

Input

One positive integer $n$.

Output

true or false accordingly.

Note

$1 \le n \le 10^{9}$

Examples

Input #1
153
Output #1
true
Input #2
154
Output #2
false

Sign in to submit a solution

Signing up is free and takes a minute.