Description
Little John is playing a very funny game with his younger brother. There is a candy box filled with candy of two different colors. At first John has to eat several candys of the same color or the same number candys of two different colors(zero is illegal). Then his younger brother has to make a turn. And so on. Please note that each player has to eat at least one candy during his turn. Who eats the last candy from the box will be considered as a loser and has to buy another new candy box.
Both players are using optimal game strategy. John starts first always. You will be given the information about candys and your task is to determine a winner of such a beautiful game.
Input
The first line of input will contain a single integer T, the number of test cases. In the next T lines, each line will contain two numbers a and b(0
Output
Output T lines, each of them containing information about the game winner. Print “John” if John will have to buy a new candy box or “Brother” in other case.
Sample Input
2
999 1000
1 2
Sample Output
John
Brother
Hint
T maybe as large as 1000000.
如何编程,关于博弈论的
答案:1 悬赏:60 手机版
解决时间 2021-03-11 03:54
- 提问者网友:雪舞兮
- 2021-03-10 06:51
最佳答案
- 五星知识达人网友:何以畏孤独
- 2021-03-10 07:18
自己下一套Delphi的教程,很简单
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯