問題一覧 > 通常問題

No.7 Prime Number Game

レベル : / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 693
作問者 : yuki2006
お気に入りにしたユーザー ProblemId : 25 / 自分の提出
問題文最終更新日: 2026-06-25 21:28:54
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 7 (順位表) の他の問題:

Problem Statement

You and Eve, who has just learned about prime numbers, came up with a game about prime numbers.

The rules of the game are as follows.
・First, the first player is given a natural number \(N\) that is at least \(2\).
・The player whose turn it is subtracts from \(N\) one of the "prime numbers less than or equal to \(N\) (including \(N\) itself)".
Letting \(N'\) be the resulting number, if \(N'\) becomes \(0\) or \(1\), that player loses.
・After that, \(N'\) becomes the new \(N\), the number is passed to the opponent, and the above is repeated.

You start the game as the first player.
Assume that both players move so as not to lose. Given a natural number \(N\),
return \(Win\) if you can win, and \(Lose\) otherwise.

Input

\(N\)

\(2 \leq N \leq 10000\)

Output

Print Win or Lose.
Print a newline at the end.

Sample

Sample 1
Input
5
Output
Win

From \(5\), subtract \(3\), a prime number less than or equal to \(5\), and pass \(2\) to the opponent.
(If you subtract \(5\), you lose immediately.)
Eve can only subtract \(2\) from it, so you win.
(You may also subtract \(2\) first.)

Sample 2
Input
12
Output
Lose

If Eve chooses the best moves, you will lose.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。