No.2551 2, 3, 5, 7 Game
タグ : / 解いたユーザー数 26
作問者 :
sepa38
Seed57_cash
Problem Statement
There is a number $X$, and sepa and ryota play a game using this number $X$.
Before the game starts, $X = 1$.
With sepa moving first and ryota moving second, they take turns repeating the following operation until the game ends.
- The player whose turn it is chooses $1$ number from among $2, 3, 5, 7$. Letting $a$ be the chosen number, $X$ is changed to its value multiplied by $a$.
If $X$ becomes $N$ or greater after an operation, the game ends and the player who performed the last operation loses.
You are given $T$ values $N_i$. For each of them, determine who wins when both players act optimally.
Constraints
- $1 \leq T \leq 2 \times 10^{5}$
- $2 \leq N \leq 10^{16}$
- All inputs are integers.
Input
The input is given from standard input in the following format.
$T$ $N_1$ $\vdots$ $N_T$
Output
Print sepa if sepa wins when both players act optimally, and ryota if ryota wins.
Sample
Sample 1
Input
3 11 2 2357
Output
sepa ryota sepa
For the first case, if sepa chooses $7$ first, sepa can always win no matter what operation ryota performs.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。