C - Little Deer and Blue Cat
Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)
DOTA, there are two Intellegence heroes. One is
Enchantress, who is usually called
Little Deer by Chinese players. The other is
Storm Spirit, who is usually called
Blue Cat by Chinese players.
Well, in UESTC-ACM Team, there are two Intellegent team members. One is
acerlawson, who is usually called
God Liby others. The other is
qzy, who is usually called
Master Qiu by others.
acerlawson are arguing with each other about who is the best
DOTA player in the team, so they want to play a game. The game is played in
DOTA. However, the rule of the game is quite different from
In the game,
Little Deer, and
Blue Cat. They plays the game in turn, and
acerlawson goes first. At frist,
Little Deer has A HP, and
Blue Cat has B HP. In each hero's turn, the hero can choose an integer P and attack the enemy. The enemy will lose P HP. Here P can be 1 or any prime number not greater than the enemy's HP. The one whose HP become 0 first will lose the game.
As they are both intellegent, they will make the best choice to win this game. In another word, they will try to kill the other as early as possible.
Your task is really simple: Given A and B, find out who will win this game.
The first line is an integer T(1≤T≤1000), the number of test cases.
Then T lines follows.
Each line contains two integers A and B(1≤A,B≤108).
For each test case, print
God Li if acerlawson will win the game. Otherwise print
Sample input and output
|Sample Input||Sample Output|
3 2 4 4 4 99999989 4
Master Qiu God Li Master Qiu
举个栗子： a=4,b=4, b先出手
b: 素数3 a=4-3=1
a： 同上 b=1
b: 1 a=1-1=0
1. 注意 1<a,b<10^8，而且内存占用65m，所以你可以把所有小于10^8的素数找出来，存到数组里，到时候直接用就好了。（10^8个数大概要400m空间，我不知道素数有多少，如果放不完的话，你就可以舍弃部分小的素数）
对呀 对呀 光是还要判断是否为素数就会超时 又会超限
我用的埃氏打表法 各种超 T.T T.T