#T366. 取石子游戏

取石子游戏

Description

There are two piles of stones, and two players take turns removing stones. On each turn, a player must take stones from the larger pile, and the number of stones taken must be an integer multiple of the number of stones in the smaller pile. The player who empties one of the piles wins.
For example, the initial number of stones in the two piles could be 25 and 7.

Input Format

The input contains multiple test cases. Each test case consists of a single line with two positive integers, a and b, representing the initial number of stones in the two piles.
The input ends with two 0s.

Output Format

For each test case, if the first player can win, output "win". Otherwise, output "lose".

25 7 --> 11 7 --> 4 7 --> 4 3 --> 1 3 --> 1 0
    选手1取    选手2取    选手1取    选手2取    选手1取

34 12
15 24
0 0


Hint

Assume the number of stones is (a, b) with a ≥ b. If ⌊a/b⌋ ≥ 2, then the first player has a winning strategy. If ⌊a/b⌋ < 2, then the first player has only one possible move. Here, ⌊a/b⌋ represents the floor value of a divided by b.