Problem L
Distance Game
Alice and Bob are playing a game on an
The Manhattan distance between two positions
For example, here is one possible initial state of the grid,
and two possible moves that a player can make. Notice that for
each move, all squares within Manhattan distance
![\includegraphics[scale=0.5]{distancegame.png}](/problems/oddgame/file/statement/en/img-0001.png)
The player who colors the last square black wins. Given that Alice goes first, who will win if both players play optimally?
Input
The first line of the input contains a single integer
The first line of each test case contains two integers
The
It is guaranteed that the sum of
Output
For each test case, output “Alice” (without quotes) if Alice will win if both players play optimally, and “Bob” otherwise.
Sample Input 1 | Sample Output 1 |
---|---|
7 6 8 BBBWWWWB WBWBWWWB WWWWWWWW BBWWWWWB WBBWBWWW WBWBBWWB 1 1 W 1 1 B 3 3 WWW WWW WWW 4 5 WBWBW BWBWB WBWBW BWBWB 10 11 WBBBWWWWWWW WWWWWWWBWWW BWWWWWWWBBW WBBWBWWWWWB WWBWBBWWWBW WWWWWWWWBWW WWWWWWBWWBW BBWWWBWWWWW WWBWBWWWBWW WWWBWWBWWWB 8 3 BWW BWB BWW WBW WWW WWW BWW BBW |
Alice Alice Bob Alice Bob Alice Bob |