310996: CF1919A. Wallet Exchange

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Wallet Exchangetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Alice and Bob are bored, so they decide to play a game with their wallets. Alice has $a$ coins in her wallet, while Bob has $b$ coins in his wallet.

Both players take turns playing, with Alice making the first move. In each turn, the player will perform the following steps in order:

  1. Choose to exchange wallets with their opponent, or to keep their current wallets.
  2. Remove $1$ coin from the player's current wallet. The current wallet cannot have $0$ coins before performing this step.

The player who cannot make a valid move on their turn loses. If both Alice and Bob play optimally, determine who will win the game.

Input

Each test contains multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 1000$) — the number of test cases. The description of the test cases follows.

The first and only line of each test case contains two integers $a$ and $b$ ($1 \le a, b \le 10^9$) — the number of coins in Alice's and Bob's wallets, respectively.

Output

For each test case, output "Alice" if Alice will win the game, and "Bob" if Bob will win the game.

ExampleInput
10
1 1
1 4
5 3
4 5
11 9
83 91
1032 9307
839204 7281
1000000000 1000000000
53110 2024
Output
Bob
Alice
Bob
Alice
Bob
Bob
Alice
Alice
Bob
Bob
Note

In the first test case, an example of the game is shown below:

  • Alice chooses to not swap wallets with Bob in step 1 of her move. Now, $a=0$ and $b=1$.
  • Since Alice's wallet is empty, Bob must choose to not swap their wallets in step 1 of his move. Now, $a=0$ and $b=0$.
  • Since both Alice's and Bob's wallets are empty, Alice is unable to make a move. Hence, Bob wins.

In the second test case, an example of the game is shown below:

  • Alice chooses to swap wallets with Bob in step 1 of her move. Now, $a=3$ and $b=1$.
  • Bob chooses to swap wallets with Alice in step 1 of his move. Now, $a=1$ and $b=2$.
  • Alice chooses to not swap wallets with Bob in step 1 of her move. Now, $a=0$ and $b=2$.
  • Since Alice's wallet is empty, Bob can only choose to not swap wallets with Alice in step 1 of his move. Now, $a=0$ and $b=1$.
  • Since Alice's wallet is empty, Alice can only choose to swap wallets with Bob in step 1 of her move. Now, $a=0$ and $b=0$.
  • Since both Alice's wallet and Bob's wallet are empty, Bob is unable to make a move. Hence, Alice wins.

Output

题目大意:
Alice和Bob通过交换钱包来玩游戏,Alice的钱包里有a个硬币,Bob的钱包里有b个硬币。两人轮流进行操作,Alice先开始。每轮操作分为两步,按顺序执行:

1. 选择是否与对手交换钱包。
2. 从当前钱包中移除1个硬币。在这一步之前,当前钱包不能没有硬币。

无法进行有效操作的一方输掉游戏。如果Alice和Bob都进行最佳操作,确定谁将赢得游戏。

输入数据格式:
每个测试包含多个测试用例。第一行包含一个整数t(1≤t≤1000)——测试用例的数量。接下来是每个测试用例的描述。

每个测试用例的第一行(也是唯一一行)包含两个整数a和b(1≤a,b≤10^9)——分别表示Alice和Bob钱包中的硬币数量。

输出数据格式:
对于每个测试用例,如果Alice将赢得游戏,则输出“Alice”,如果Bob将赢得游戏,则输出“Bob”。题目大意: Alice和Bob通过交换钱包来玩游戏,Alice的钱包里有a个硬币,Bob的钱包里有b个硬币。两人轮流进行操作,Alice先开始。每轮操作分为两步,按顺序执行: 1. 选择是否与对手交换钱包。 2. 从当前钱包中移除1个硬币。在这一步之前,当前钱包不能没有硬币。 无法进行有效操作的一方输掉游戏。如果Alice和Bob都进行最佳操作,确定谁将赢得游戏。 输入数据格式: 每个测试包含多个测试用例。第一行包含一个整数t(1≤t≤1000)——测试用例的数量。接下来是每个测试用例的描述。 每个测试用例的第一行(也是唯一一行)包含两个整数a和b(1≤a,b≤10^9)——分别表示Alice和Bob钱包中的硬币数量。 输出数据格式: 对于每个测试用例,如果Alice将赢得游戏,则输出“Alice”,如果Bob将赢得游戏,则输出“Bob”。

加入题单

上一题 下一题 算法标签: