#arc174f. F - Final Stage
F - Final Stage
Points: points
问题陈述
玩家Alice和Bob使用长度为的序列和进行游戏,规则如下:
- 游戏由个回合组成。
- 如果是奇数,第个回合由Alice进行;如果是偶数,第个回合由Bob进行。
- 游戏开始时,有一个包含一些石头的堆。
- 对于,按照这个顺序,他们执行以下操作(称为第个回合):
- 进行第个回合的玩家从堆中取走到(包括和)之间的整数个石头。
- 如果玩家不能取走满足上述条件的石头,他们就输了,另一个玩家赢了。
- 如果到第个回合结束时,没有玩家输掉游戏,游戏以平局结束。
游戏开始前,两位玩家都会知道序列和以及游戏开始时堆中的石头数量。
可以证明,游戏恰好有以下三种结果之一:
Alice
... Alice有一个获胜策略。Bob
... Bob有一个获胜策略。Draw
... 没有玩家有获胜策略。
回答关于这个游戏的个问题。第个问题如下:
- 假设游戏开始时堆中包含个石头。报告游戏的结果:
Alice
、Bob
或Draw
。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Players Alice and Bob play a game using sequences and of length , as follows.
- The game consists of turns.
- If is odd, turn is played by Alice; if is even, turn is played by Bob.
- Initially, there is a pile with some number of stones.
- For in this order, they perform the following operation (called turn ):
- The player who plays turn takes an integer number of stones between and , inclusive, from the pile.
- If the player cannot take stones satisfying the above, they lose, and the other player wins.
- If neither player has lost by the end of turn , the game ends in a draw.
Before the game starts, both players are informed of the sequences and and the number of stones in the pile at the start of the game.
It can be proved that the game has exactly one of the following three consequences:
Alice
... Alice has a winning strategy.Bob
... Bob has a winning strategy.Draw
... Neither player has a winning strategy.
Answer queries about this game. The -th query is as follows:
- Assume that the pile contains stones at the start of the game. Report the consequence of the game:
Alice
,Bob
, orDraw
.
Constraints
- , , , , and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain the answer to the -th query.
Sample Input 1
4
1 3
1 2
3 4
1 2
11
1
2
3
4
5
6
7
8
9
10
11
Sample Output 1
Alice
Alice
Alice
Bob
Bob
Alice
Alice
Alice
Draw
Draw
Draw
This input contains queries.
- When , Alice can take all stones on turn , leaving no stones in the pile, so Alice has a winning strategy.
- When , Bob has a winning strategy.
- When , Alice has a winning strategy.
- When , neither player has a winning strategy.
- For example, if , the game could proceed as follows:
- On turn , Alice takes stones. stones remain.
- On turn , Bob takes stone. stones remain.
- On turn , Alice takes stones. stone remains.
- On turn , Bob takes stone. No stones remain.
- Since neither player has lost by the end of turn , the game ends in a draw.
- Various other progressions are possible, but it can be shown that when , neither player has a winning strategy (if both players play optimally, the game will end in a draw).
- For example, if , the game could proceed as follows: