MMMGAME - M&M Game
题意翻译
# **题目描述**
John和他的弟弟玩的很开心。有一个装有不同颜色的M&Ms的大糖果盒。
起初John必须吃几个相同颜色的M&Ms。然后他的对手必须做同样的事。
请注意,每位玩家在轮到他们时必须至少吃一个M&M。
如果约翰(或他的兄弟)将从盒子中吃掉最后一个M&M,另一个人将获胜,他将不得不购买一个盒新糖果。
两位玩家都都非常聪明,能够有最佳的策略。John总是先开始。你将获得有关M&M的信息,你的任务是找到赢家是谁。
# 输入输出格式
**输入格式:**
第一行输入将包含一个整数T - 表示接下来有T组输入
接下来的T行:
每个测试的第一行将包含一个整数N
盒子里有不同的M&M颜色。下一行将包含N个整数Ai,
用空格分隔 - 第i种颜色的M&Ms数量。
限制:
1 <= T <= 474,
1 <= N <= 47,
1 <= Ai <= 4747
**输出格式:**
输出T行,每行包含有关游戏获胜者的信息。
如果John将赢得比赛,则输出“John”,或者在其他情况下输出“Brother”。
题目描述
[English](/problems/MMMGAME/en/) [Vietnamese](/problems/MMMGAME/vn/) ```
Little John is playing very funny game with his younger brother. There is
one big box filled with M&Ms of different colors. At first John has
to eat several M&Ms of the same color. Then his opponent has to make a turn.
And so on. Please note that each player has to eat at least one M&M
during his turn. If John (or his brother) will eat the last M&M from the
box he will be considered as a looser and he will have to buy a new candy box.
Both of players are using optimal game strategy. John starts first always.
You will be given information about M&Ms and your task is to determine a
winner of such a beautiful game.
```
输入输出格式
输入格式
```
The first line of input will contain a single integer T – the number of
test cases. Next T pairs of lines will describe tests in a following format.
The first line of each test will contain an integer N –
the amount of
different M&M colors in a box. Next line will contain N integers Ai,
separated by spaces – amount of M&Ms of i-th color.
Constrains:
1 <= T <= 474,
1 <= N <= 47,
1 <= Ai <= 4747
```
输出格式
```
Output T lines each of them containing information about game winner.
Print “John” if John will win the game or “Brother” in other case.
```