1226. Stones Game

单点时限: 2.0 sec

内存限制: 256 MB

This game is a two-player game and is played as follows:

1:there are N stones in a box.

2:The players take turns choosing M numbers of stones and throw it out of the box. M is in {1,3,4}.

3:Who can not throw the stones any more will loss the game.

Give an Initial state of the game. You are supposed to find whether the first player will win the game if both of the players make the best strategy.

输入格式

The input file contains several test cases.

Each test case begins with an integer N, 0 < N <=10000000, the number of the stones.

N = 0 indicates the end of input and should not be processed.

输出格式

For each test case, output “Win” (without quotes) on a line if the first player can win the game, otherwise output “Lost”.

样例

Input
1
2
6
7
0
Output
Win
Lost
Win
Lost

47 人解决,58 人已尝试。

56 份提交通过,共有 134 份提交。

3.7 EMB 奖励。

创建: 16 年,11 月前.

修改: 6 年,8 月前.

最后提交: 9 月前.

来源: LSP

题目标签
DP