408369: GYM103107 I ICU4C

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

Description

I. ICU4Ctime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

ICU for Car! is an exciting racing game. Two players take turns to make a move. In one move, the player chooses one car and push this car one grid right-forward. Cars satisfying all the conditions will be also pushed forward too.

  • In the same racetrack with the selected car.
  • In front of the selected car.
  • Connected with the selected car. Formally, two cars $$$x$$$ and $$$y$$$ are connected, if there is no gap between $$$x$$$ and $$$y$$$, or they are both connected with car $$$z$$$.

Note that if the right-most car in this move has already touched the finishing line, this move is not valid and you cannot process it. The player who can't make a move loses.

There are $$$n$$$ racetracks holding the cars in one game. For each racetrack, the number of cars $$$m_i$$$, the position of each car $$$x_j$$$ and the position of finishing line $$$e_i$$$ are given.

Now Alice and Bob wants to play this game and Alice takes the first turn. Can you tell wor the winner?

Input

The first line contains one integer $$$T ~ (1 \leq T \leq 20)$$$ denoting the number of test cases.

For each testcase,

The first line contains one integer $$$n ~ (1 \leq n \leq 1\,000)$$$ denoting the number of racetracks.

The $$$2i$$$-th line contains two integer $$$m_i, e_i ~ (1 \leq m_i \leq 1\,000; 0 < e_i \leq 1\,000\,000\,000)$$$ denoting there are $$$m_i$$$ cars on the racetrack $$$i$$$ and the finishing line is at $$$e_i$$$. It is guaranteed that $$$\sum m \leq 1\,500\,000$$$.

The $$$2i+1$$$-th line contains $$$m_i$$$ integers $$$x_1, x_2, \cdots, x_{m_i} ~ (0 < x_j \leq e_i)$$$ representing the initial position of each car on the racetrack $$$i$$$. It is guaranteed that $$$x_i < x_j$$$ for $$$i < j$$$.

Output

For each testcase, output one line containing the name of winner (either Alice or Bob).

ExampleInput
2
1
3 5
2 3 5
2
3 5
2 3 5
3 5
2 3 5
Output
Alice
Bob

加入题单

算法标签: