CF1841A.Game with Board

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Alice and Bob play a game. They have a blackboard; initially, there are nn integers written on it, and each integer is equal to 11 .

Alice and Bob take turns; Alice goes first. On their turn, the player has to choose several (at least two) equal integers on the board, wipe them and write a new integer which is equal to their sum.

For example, if the board currently contains integers {1,1,2,2,2,3}\{1, 1, 2, 2, 2, 3\} , then the following moves are possible:

  • choose two integers equal to 11 , wipe them and write an integer 22 , then the board becomes {2,2,2,2,3}\{2, 2, 2, 2, 3\} ;
  • choose two integers equal to 22 , wipe them and write an integer 44 , then the board becomes {1,1,2,3,4}\{1, 1, 2, 3, 4\} ;
  • choose three integers equal to 22 , wipe them and write an integer 66 , then the board becomes {1,1,3,6}\{1, 1, 3, 6\} .

If a player cannot make a move (all integers on the board are different), that player wins the game.

Determine who wins if both players play optimally.

输入格式

The first line contains one integer tt ( 1t991 \le t \le 99 ) — the number of test cases.

Each test case consists of one line containing one integer nn ( 2n1002 \le n \le 100 ) — the number of integers equal to 11 on the board.

输出格式

For each test case, print Alice if Alice wins when both players play optimally. Otherwise, print Bob.

输入输出样例

  • 输入#1

    2
    3
    6

    输出#1

    Bob
    Alice

说明/提示

In the first test case, n=3n = 3 , so the board initially contains integers {1,1,1}\{1, 1, 1\} . We can show that Bob can always win as follows: there are two possible first moves for Alice.

  • if Alice chooses two integers equal to 11 , wipes them and writes 22 , the board becomes {1,2}\{1, 2\} . Bob cannot make a move, so he wins;
  • if Alice chooses three integers equal to 11 , wipes them and writes 33 , the board becomes {3}\{3\} . Bob cannot make a move, so he wins.

In the second test case, n=6n = 6 , so the board initially contains integers {1,1,1,1,1,1}\{1, 1, 1, 1, 1, 1\} . Alice can win by, for example, choosing two integers equal to 11 , wiping them and writing 22 on the first turn. Then the board becomes {1,1,1,1,2}\{1, 1, 1, 1, 2\} , and there are three possible responses for Bob:

  • if Bob chooses four integers equal to 11 , wipes them and writes 44 , the board becomes {2,4}\{2,4\} . Alice cannot make a move, so she wins;
  • if Bob chooses three integers equal to 11 , wipes them and writes 33 , the board becomes {1,2,3}\{1,2,3\} . Alice cannot make a move, so she wins;
  • if Bob chooses two integers equal to 11 , wipes them and writes 22 , the board becomes {1,1,2,2}\{1, 1, 2, 2\} . Alice can continue by, for example, choosing two integers equal to 22 , wiping them and writing 44 . Then the board becomes {1,1,4}\{1,1,4\} . The only possible response for Bob is to choose two integers equal to 11 and write 22 instead of them; then the board becomes {2,4}\{2,4\} , Alice cannot make a move, so she wins.
首页