No.692 square1001 and Permutation 1
タグ : / 解いたユーザー数 520
作問者 :
Problem Statement
There are $n$ Permutations in a basket. Petr and square1001 decide to play a game with them. The players alternately perform the following operation.
- Take $1$ or more Permutations from the basket and eat all of the taken ones.
The player who eats the last Permutation loses, and that player's opponent wins.
Since square1001 has never beaten Petr in a Topcoder SRM, Petr moves first and square1001 moves second.
Determine which player wins when both players play optimally in order to win.
Input
$n$
Line $1$ contains an integer $n$, the number of Permutations.
Output
Print "Petr" if Petr wins this game, and "square1001" if square1001 wins this game.
Also, print a newline at the end.
Constraints
All input data satisfy the following constraints.
- $1 \le n \le 10^9$.
Sample
Sample 1
Input
2
Output
Petr
If Petr first takes $1$ Permutation, the number of remaining Permutations becomes $1$. Then square1001 has no choice but to take the last Permutation, so square1001 loses; that is, Petr wins.
Sample 2
Input
1
Output
square1001
Since there is only $1$ Permutation, Petr, who moves first, has no choice but to take the first and last Permutation. Therefore, Petr loses and square1001 wins.
Sample 3
Input
20180125
Output
Petr
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。