No.889 Prime Number!
タグ : / 解いたユーザー数 363
作問者 :
trineutron
/ テスター :
Problem Statement
In a certain choir, there is a custom that after practice, the number of days remaining until the concert is announced, and the members respond to it.
The responses are as follows.
If the number of remaining days is a prime number: Sosu!
If the number of remaining days is a perfect square of at least $2$: Heihosu!
If the number of remaining days is a perfect cube of at least $2$: Ripposu!
If the number of remaining days is a perfect number: Kanzensu!
The number of remaining days $N$ is given as input. If the response is determined, output that response; otherwise, output $N$ as is.
Here, a prime number is a natural number of at least $2$ whose only positive divisors are $1$ and itself, a perfect square is an integer that is the $2$nd power of some integer, a perfect cube is an integer that is the $3$rd power of some integer, and a perfect number is a natural number for which the sum of its positive divisors excluding itself equals itself.
Input
$N$
$N$ is an integer
$0 \le N \lt 64$
Output
If the input $N$ has a determined response, output that response; if the response is not determined, output $N$. Print a newline at the end.
Sample
Sample 1
Input
17
Output
Sosu!
Sample 2
Input
15
Output
15
Sample 3
Input
36
Output
Heihosu!
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。