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

39 人解决,49 人已尝试。

47 份提交通过,共有 117 份提交。

4.0 EMB 奖励。

创建: 13 年,1 月前.

修改: 2 年,10 月前.

最后提交: 2 月,4 周前.

来源: LSP

题目标签
DP