#arc170d. D - Triangle Card Game

D - Triangle Card Game

Score: 700700 points

问题陈述

爱丽丝和鲍勃将进行一场游戏。

最初,爱丽丝和鲍勃各自有N张卡片,爱丽丝的第i张卡片上写着整数A_i,鲍勃的第i张卡片上写着整数B_i。

游戏的进行方式如下:

  • 准备一块没有任何字迹的黑板。
  • 爱丽丝吃掉她的一张卡片,并将吃掉的卡片上的整数写在黑板上。
  • 接下来,鲍勃吃掉他的一张卡片,并将吃掉的卡片上的整数写在黑板上。
  • 最后,爱丽丝再吃掉她的一张卡片,并将吃掉的卡片上的整数写在黑板上。

如果用写在黑板上的三个整数作为边长可以形成一个(非退化的)三角形,爱丽丝就赢了;否则,鲍勃赢了。

当两位玩家都采取最优行动时,确定谁赢了。

解决给定的T个测试用例中的每一个。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

Alice and Bob will play a game.

Initially, Alice and Bob each have NN cards, with the ii-th card of Alice having the integer AiA_i written on it, and the ii-th card of Bob having the integer BiB_i written on it.

The game proceeds as follows:

  • Prepare a blackboard with nothing written on it.
  • Alice eats one of her cards and writes the integer from the eaten card on the blackboard.
  • Next, Bob eats one of his cards and writes the integer from the eaten card on the blackboard.
  • Finally, Alice eats one more of her cards and writes the integer from the eaten card on the blackboard.

If it is possible to form a (non-degenerate) triangle with the side lengths of the three integers written on the blackboard, Alice wins; otherwise, Bob wins.

Determine who wins when both players act optimally.

Solve each of the TT given test cases.

Constraints

  • 1T1051 \leq T \leq 10^5
  • 2N2×1052 \leq N \leq 2 \times 10^5
  • 1Ai,Bi1091 \leq A_i, B_i \leq 10^9
  • All input values are integers.
  • The sum of NN over all test cases in a single input is at most 2×1052 \times 10^5.

Input

The input is given from Standard Input in the following format:

TT

case1\mathrm{case}_1

\vdots

caseT\mathrm{case}_T

Each case is given in the following format:

NN

A1A_1 \ldots ANA_N

B1B_1 \ldots BNB_N

Output

Print TT lines. The ii-th line (1iT)(1 \leq i \leq T) should contain Alice if Alice wins for the ii-th test case, and Bob if Bob wins.

Sample Input 1

3
3
1 2 3
4 5 6
4
6 1 5 10
2 2 4 5
10
3 1 4 1 5 9 2 6 5 3
2 7 1 8 2 8 1 8 2 8

Sample Output 1

Bob
Alice
Alice

In the first test case, for example, the game could proceed as follows:

  • Alice eats the card with 22 written on it and writes 22 on the blackboard.
  • Bob eats the card with 44 written on it and writes 44 on the blackboard.
  • Alice eats the card with 11 written on it and writes 11 on the blackboard.
  • The numbers written on the blackboard are 2,4,12, 4, 1. There is no triangle with side lengths 2,4,12, 4, 1, so Bob wins.

For this test case, the above process is not necessarily optimal for the players, but it can be shown that Bob will win if both players act optimally.