#K88777. Happy Number Checker

    ID: 37384 Type: Default 1000ms 256MiB

Happy Number Checker

Happy Number Checker

A happy number is defined as follows: starting from any positive integer \(n\), replace the number by the sum of the squares of its digits, i.e. \(S(n)=\sum_{i} d_i^2\). Repeat the process until the number either equals 1 (where it will remain), or loops endlessly in a cycle that does not include 1. If the process ends in 1, then \(n\) is a happy number, otherwise it is unhappy. Note that for this problem, numbers less than or equal to 0 are not considered happy.

For example, when \(n=19\), the process is: \(19 \to 1^2+9^2=82 \to \dots \to 1\), so 19 is a happy number.

inputFormat

The input consists of a single integer \(n\) (\(n\) can be positive, zero, or negative) provided via standard input.

outputFormat

Output to standard output True if \(n\) is a happy number; otherwise, output False.

## sample
19
True

</p>