永发信息网

如何编程,关于博弈论的

答案:1  悬赏:60  手机版
解决时间 2021-03-11 03:54
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.
最佳答案
自己下一套Delphi的教程,很简单
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
那英有几个孩子她老公是谁
昨天杭州的雨下的好大啊,出门都没带伞,听说
内蒙古盲人按摩在什么地方啊,我要过去处理事
干海参可以生吃吗
顽固不化的反义词是什么(形容人灵活变通的)
才字的五行属性
邯郸学院和南通大学那个好
小泰迪驱虫药怎么吃
家里水管总阀门关着,楼层总阀门也关着楼下卫
新疆容利原通国际货运代理有限公司地址在哪,
(10分)孔子及儒家文化的命运,在历史的波涛
长城传奇6901028029018烟多少钱一包
2,4,8,16,32……这些2的n次方的数又叫什
谁知道天元突破720p MKV或RMVB的下载地址,贪
葡萄糖与新制氢氧化铜常温反应溶液为什么变成
推荐资讯
粉刺针怎么用?会留疤吗
自己的疑心病让我不相信任何人,觉得人家对我
我4两二命,今年39岁,女,请问几岁才顺心,各方
深圳梅观路限外地牌吗,我是惠州牌皮卡车,想
我想单独立户,房产证上是我爸的名字,怎么立
求一开始玩就是帝王的游戏,有妃子,还有打仗
故事中的故事百度云高清有字幕,谢谢么么哒
印象郴州假日酒店火车站广场店怎么去啊,有知
常德沙钵土鸡做法
男,13岁,小学勉强毕业,现读初一。学习成绩
90’PEOPLE炸鸡和啤酒怎么去啊,有知道地址的
一年级读书征文家有读书娃
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?