A Game Between Alice and Bob

TimeLimit: 5000ms  MemoryLimit:262144KB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

Alice and Bob play the following game. A series of numbers is written on the blackboard. Alice and Bob take turns choosing one of the numbers, and replace it with one of its positive factor but not itself. The one who makes the product of all numbers become 1 wins. You can assume Alice and Bob are intelligent enough and Alice take the first turn. The problem comes, who is the winner and which number is Alice's first choice if she wins?

Alice 和 Bob 在玩一个游戏。 开始时有n个数字,每次操作可以选择其中的一个数,把它变成一个它的因子(但不包括本身),把所有数变成1的那个人获胜。Alice先操作,然后双方轮流操作,那么谁将赢得这个游戏,如果Alice获胜,那么他第一步应该选择第几个数字?
Input

This problem contains multiple test cases. The first line of each case contains only one number N (1<= N <= 100000) representing there are N numbers on the blackboard. The second line contains N integer numbers specifying the N numbers written on the blackboard. All the numbers are positive and less than or equal to 5000000.

Output

Print exactly one line for each test case. The line begins with "Test #c: ", where c indicates the case number. Then print the name of the winner. If Alice wins, a number indicating her first choice is acquired, print its index after her name, separated by a space. If more than one number can be her first choice, make the index minimal.

SampleInput
4
5 7 9 12
4
41503 15991 72 16057 
SampleOutput
Test #1: Alice 1
Test #2: Bob
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数1
总提交量2
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: