F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Alice and Bob

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65536 K (Java/Others)
Total Submission(s): 1058    Accepted Submission(s): 497


Problem Description
Alice and Bob are playing a stone game in a board of $n\times m$ cells.

In the begining, the stone is in the upperleft cell. And in each turn, they can move the stone one cell to the right or one cell down, or diagonally $k$ cells down to the right, which means if you are at $(x,y)$, then you could move into $(x+1,y)$, $(x,y+1)$ or $(x+k,y+k)$ at the next step. The player who can not move loses. They play in turns and Alice moves first.

Now given $n$, $m$ and $k$, could you tell me who is the winner?
 

Input
First line contains an integer $T(1\leq T\leq 10)$, denoting the number of test cases.

In each test case, the first line is two integers $Q$ and $k$.
In the following $Q$ lines, each line contains $n$ and $m$.$(1\leq Q\leq 1000,1\leq k,n,m\leq 10^9)$
 

Output
For each test case, output $Q$ lines.
If Alice is the winner, output ``Alice''. Otherwise ``Bob''.
 

Sample Input
2 2 1 4 5 3 4 2 3 4 5 5 6
 

Sample Output
Alice Alice Alice Bob
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-19 23:15:36, Gzip enabled