21976_Game

2022-5-16 18:20| 发布者: Hocassian| 查看: 27| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-895069574500-Problem List-采集的数据-后羿采集器.html

Pro.ID

21976

Title

Game

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21976

AC

6

Submit

7

Ratio

85.71%

时间&空间限制

  • Time Limit: 600/300 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    Bob and Alice are playing a new game. There are n boxes which have been numbered from 1 to n. Each box is either empty or contains several cards. Bob and Alice move the cards in turn. In each turn the corresponding player should choose a non-empty box A and choose another box B that B<A && (A+B)%2=1 && (A+B)%3=0. Then, take an arbitrary number (but not zero) of cards from box A to box B. The last one who can do a legal move wins. Alice is the first player. Please predict who will win the game.

    输入

    The first line contains an integer T ( T ≤ 100 ) indicating the number of test cases. The first line of each test case contains an integer n ( 1 ≤ n ≤ 10000 ). The second line has n integers which will not be bigger than 100. The i-th integer indicates the number of cards in the i-th box.

    输出

    Description

    Bob and Alice are playing a new game. There are n boxes which have been numbered from 1 to n. Each box is either empty or contains several cards. Bob and Alice move the cards in turn. In each turn the corresponding player should choose a non-empty box A and choose another box B that B<A && (A+B)%2=1 && (A+B)%3=0. Then, take an arbitrary number (but not zero) of cards from box A to box B. The last one who can do a legal move wins. Alice is the first player. Please predict who will win the game.

    Input

    The first line contains an integer T ( T ≤ 100 ) indicating the number of test cases. The first line of each test case contains an integer n ( 1 ≤ n ≤ 10000 ). The second line has n integers which will not be bigger than 100. The i-th integer indicates the number of cards in the i-th box.

    Output

    For each test case, print the case number and the winner's name in a single line. Follow the format of the sample output.

    Sample Input

    2
    2
    1 2
    7
    1 3 3 2 2 1 2

    Sample Output

    Case 1: Alice
    Case 2: Bob

    Source

    样例输入

    2
    2
    1 2
    7
    1 3 3 2 2 1 2

    样例输出

    Case 1: Alice
    Case 2: Bob

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部