CF1194D.1-2-K Game

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Alice and Bob play a game. There is a paper strip which is divided into n+1n+1 cells numbered from left to right starting from 00 . There is a chip placed in the nn -th cell (the last one).

Players take turns, Alice is first. Each player during his or her turn has to move the chip 11 , 22 or kk cells to the left (so, if the chip is currently in the cell ii , the player can move it into cell i1i-1 , i2i-2 or iki-k ). The chip should not leave the borders of the paper strip: it is impossible, for example, to move it kk cells to the left if the current cell has number i<ki<k . The player who can't make a move loses the game.

Who wins if both participants play optimally?

Alice and Bob would like to play several games, so you should determine the winner in each game.

输入格式

The first line contains the single integer TT ( 1<=T<=1001<=T<=100 ) — the number of games. Next TT lines contain one game per line. All games are independent.

Each of the next TT lines contains two integers nn and kk ( 0<=n<=1090<=n<=10^{9} , 3<=k<=1093<=k<=10^{9} ) — the length of the strip and the constant denoting the third move, respectively.

输出格式

For each game, print Alice if Alice wins this game and Bob otherwise.

输入输出样例

  • 输入#1

    4
    0 3
    3 3
    3 4
    4 4
    

    输出#1

    Bob
    Alice
    Bob
    Alice
    
首页