Alice and Bob play
Practice
2.2 (10 votes)
Ad Hoc
Mathematics
Easy Medium
Game theory
Problem
56% Success 4889 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Alice and Bob are playing a game yet again. There is a grid with N rows and M columns. Each cell of this grid is initially empty.

Alice and Bob play turn wise, with Alice playing first. In each turn, the player whose turn it is can choose a cell and write a non-negative 32-bit unsigned integer in it. After all the cells are filled, N values are computed, such that the \(i^{th}\) of them denotes the xor of all the values in the \(i^{th}\) row. If any of the N values computed is 0, then Alice loses and Bob wins. Otherwise, Alice wins. For better understanding, refer to sample explanation.

You will be given the integers N and M. Find out who will win the game.

You can assume that since Alice and Bob have been playing a lot of games since the beginning of time, they will be playing optimally.

Input Format

The first line will contain an integer T, denoting the number of test cases.

Each of the next T lines will contain two space-separated integers, N and M denoting the number of rows and number of columns respectively

Output Format

For each of T test cases, print "Alice" if Alice wins, otherwise, print "Bob". (without quotes)

Constraints

\(1 \le T \le 10^3\)

\(1 \le N, M \le 10^9\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
2 votes
Tags:
Easy-Medium