logo AlgoBeat OnlineJudge
登录 注册

#214894. [NERC 2025] Battle of Arrays

内存限制:1024 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Alice and Bob play a turn-based game. Initially, Alice has an array of positive integers, and Bob has an array of positive integers. The players take turns, with Alice moving first.

On a player’s turn, they must choose one element from their own array and the maximal element from their opponent’s array. Then they perform the following operation:

  • If : the element is destroyed (removed from the opponent’s array).
  • If : the element is decreased by (the value of becomes ).

A player wins if, after their move, the opponent’s array becomes empty.

Assuming both players play optimally, determine the winner.

输入格式

Each input contains multiple test cases. The first line contains the number of test cases (). The first line of each test case contains two integers and () — the sizes of Alice’s and Bob’s arrays respectively.

The second line contains integers () — Alice’s array.

The third line contains integers () — Bob’s array.

It is guaranteed that the sum of over all test cases does not exceed and the sum of over all test cases does not exceed .

输出格式

For each test case, print the name of the winner of the game if both players follow the optimal strategy: “Alice” or “Bob”.

样例

样例输入 1

2
1 1
70
90
2 3
30 30
20 20 40

样例输出 1

Alice
Bob

数据范围与提示

In the first test Alice moves and decreases Bob’s element by , so it becomes . Then Bob moves and decreases Alice’s element by , so it becomes . Finally, Alice moves, destroys Bob’s element, and wins.