#P9486. 「LAOI-1」Bash Game-Plus
「LAOI-1」Bash Game-Plus
Problem Description
Bash game: There is a pile of items. Two players take turns taking items from it. Each time, at least item and at most items must be taken; skipping is not allowed. The player who takes the last item wins.
We add some rules to this game:
There is a pile of items. Player A and player B take turns taking items, and player A goes first. Each time, at least item and at most items must be taken. The player who takes all remaining items wins.
Now a new rule is added: you may also choose to take nothing. However, whenever a player chooses to take nothing, in the next moves, neither player is allowed to take nothing.
For example, when , if player A takes nothing in some move, then in the next three turns (player B, player A, player B), they must each take at least item. After that, it is player A's turn again, and now player A may choose to take nothing again.
Player A and player B play a total of games. For each game, you need to tell player A whether he has a winning strategy.
Input Format
The first line contains two positive integers . When , the newly added rule is canceled, but you still need to read normally.
The next lines each contain three positive integers .
Output Format
For each game, if player A has a winning strategy, output Yes. Otherwise output No.
6 0
2 2 2
3 2 2
4 2 2
7 2 3
13 2 6
14 2 6
Yes
Yes
No
Yes
Yes
No
6 0
4 3 2
5 3 3
13 3 5
13 3 6
5 100 1000000000000
123454204 4321 97
Yes
No
Yes
No
Yes
No
Hint
| Subtask | Score | Special property | |||||
|---|---|---|---|---|---|---|---|
| Not allowed, Commander-in-Chief | |||||||
Special property : all are equal.
For all data: , .
The testdata is not guaranteed to be random.
Translated by ChatGPT 5