|
||||||||||
Fall with IntersectionTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 73 Accepted Submission(s): 21 Problem Description Alice and Bob are playing a game, the rules are as follow. Initially, there is an infinite plane with $w$ straight lines. Alice and Bob now draw new lines in turn, $m$ rounds in total (so there will be $w+2m$ lines in the end). Alice goes first and they can not draw a line that already exists in the plane. After that, these lines will produce some intersections, if the number of intersections is odd, then Bob wins, otherwise, Alice wins. If multiple lines intersect at one point, this intersection will only be counted once. The game has reached a white-hot stage, there have been $w+n$ lines on the plane. Now Alice and Bob are very focused and their brains are racing that all the decisions they make will be optimal. All the straight lines should be in the form of $y=kx+b$, where $k$ and $b$ are integers, but there is no limitation of the range(except the first $w+n$ lines). Fall is interesting with the final result. Can you tell him who will be the winner in the end? Input The first line contains a single integer T ($1\leq T \leq 100$), the number of test cases. For each test case: The first line contains three integers, $w,m,n(0\leq w\leq 5,1\leq m\leq 500,\sum{m}\leq 1300, 0\leq n\leq 2m)$, with the same meaning as described above. The next $w+n$ lines, each line contains two integers $k_i,b_i(-10^6\leq k_i,b_i\leq 10^6)$, representing the $i$-th line one the plane is $y=k_ix+b_i$. It is guaranteed that $\forall i\neq j, k_i\neq k_j$ or $b_i\neq b_j$. Output For each test case, output a single line containing one string ("Alice'' or "Bob'', without quotation marks), representing the winner. Sample Input
Sample Output
Hint For the first test case, they have drawn 3 lines so it's Bob's turn to draw the last line. But whatever Bob draws, the number of intersections is always an even number. For the second test case, the third line should be drawn by Alice. She can draw a line $y=0x+5$ so that it would be the same as the first case. Source | ||||||||||
|