301497: CF282D. Yet Another Number Game

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Yet Another Number Game

题意翻译

给定一个有n(1<=n<=3)个元素的非负整数序列a1—an(0<ai<=300),两位玩家轮流进行如下操作之一: 1. 为ai(0<i<=n)减去一个小于它的整数x(0<x<=ai); 2. 为序列中的每一个元素都减去一个整数x,x要小于序列中的每一个元素(x>0)。 由BitLGM先手,BitAryo后手。每回合两人都必须进行上面两种操作中的一种。当一个人不能进行任何操作,即序列中的所有元素均为0时,此人失败。 要求输出在两人都以最优策略进行游戏的情况下必胜的那一方。

题目描述

Since most contestants do not read this part, I have to repeat that Bitlandians are quite weird. They have their own jobs, their own working method, their own lives, their own sausages and their own games! Since you are so curious about Bitland, I'll give you the chance of peeking at one of these games. BitLGM and BitAryo are playing yet another of their crazy-looking genius-needed Bitlandish games. They've got a sequence of $ n $ non-negative integers $ a_{1},a_{2},...,a_{n} $ . The players make moves in turns. BitLGM moves first. Each player can and must do one of the two following actions in his turn: - Take one of the integers (we'll denote it as $ a_{i} $ ). Choose integer $ x $ $ (1<=x<=a_{i}) $ . And then decrease $ a_{i} $ by $ x $ , that is, apply assignment: $ a_{i}=a_{i}-x $ . - Choose integer $ x $ ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF282D/cfd12ee35f4fd2cdcce2f524b91ce3785f31af4d.png). And then decrease all $ a_{i} $ by $ x $ , that is, apply assignment: $ a_{i}=a_{i}-x $ , for all $ i $ . The player who cannot make a move loses. You're given the initial sequence $ a_{1},a_{2},...,a_{n} $ . Determine who wins, if both players plays optimally well and if BitLGM and BitAryo start playing the described game in this sequence.

输入输出格式

输入格式


The first line contains an integer $ n $ ( $ 1<=n<=3 $ ). The next line contains $ n $ integers $ a_{1},a_{2},...,a_{n} $ $ (0<=a_{i}&lt;300) $ .

输出格式


Write the name of the winner (provided that both players play optimally well). Either "BitLGM" or "BitAryo" (without the quotes).

输入输出样例

输入样例 #1

2
1 1

输出样例 #1

BitLGM

输入样例 #2

2
1 2

输出样例 #2

BitAryo

输入样例 #3

3
1 2 1

输出样例 #3

BitLGM

Input

题意翻译

给定一个有n(1<=n<=3)个元素的非负整数序列a1—an(0<ai<=300),两位玩家轮流进行如下操作之一: 1. 为ai(0<i<=n)减去一个小于它的整数x(0<x<=ai); 2. 为序列中的每一个元素都减去一个整数x,x要小于序列中的每一个元素(x>0)。 由BitLGM先手,BitAryo后手。每回合两人都必须进行上面两种操作中的一种。当一个人不能进行任何操作,即序列中的所有元素均为0时,此人失败。 要求输出在两人都以最优策略进行游戏的情况下必胜的那一方。

加入题单

算法标签: