欢迎来到 NKOJ

2017.12.8 我们为它加入了新的语言 Python~ 欢迎尝试

如果您对 OJ 的进一步开发,包括前端/后台/数据库设计,有兴趣,请联系 sunrisefox@qq.com ~

<<Previous Next>>
[ Source : ]

 2333: 父子之战

Time Limit: 1000 ms Memory Limit: 65536kB
Total Submit : 169 (51 users) Accepted Submit : 60 (48 users) Page View : 789
Font Style: Aa Aa Aa

Recently, Mr. Peng and his girlfriend have been addicted to a game. The rules of the game are very simple. At the start of the game, a pawn is placed at the starting point (1,1) on a N*M board. Then Mr. Peng and his girlfriend take turns (Mr. Peng moves first) moving the pawn. When his/her turn comes, a player may choose to take one or two moves. Within each move, he/she can either move the pawn one square upwards, or one square to the right. Whoever takes the pawn to the destination (n,m) wins. Now Mr. Peng wants to know whether there is a winning strategy for him (i.e. if he plays a certain strategy, he can be sure to win).


The first line should contain an integer t (1<=t<=10), indicating the number of test cases.

For each test case, there should be one line containing two integers N and M, indicating the size of the board. Make sure that 1<=N,M<=1000.


For each test case, output one string in a single line: If Mr. Peng can win, output "Don't worry!"; Otherwise, output "Too Peng!"

Sample Input

4 4
3 3

Sample Output

Too Peng!
Don't worry!


Best User : 57890

If the buttons do not work well , you may try Submit , Status , Post , 0 post(s), Back .

Editor : clover520 | Last update : clover520 | History
NKOJ Ver 2.0.0 | FAQ | | 9 ms : 8 | PageView:24136805
NKUACM 2017 [加入QQ群] 南开ACM协会 [加入QQ群]
© Copyright 2005-2018 Sun Wei & Wang Yan & SunriseFox . All Rights Reserved.

如果您愿意加入 OJ 的开发,请联系 sunrisefox@qq.com ~