Click Open link
Kiki's game
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 40000/1000 K (Java/Others)
Total Submission (s): 6933 Accepted Submission (s): 4141
Problem DescriptionRecently kiki has nothing to do. while she is bored, an idea appears in his mind, she just playes the checkerboard game. the size of the chesserboard is n * m. first of all, a coin is placed in the top right corner (1, m ). each time one people can move the coin into the left, the underneath or the left-underneath blank space. the person who can't make a move will lose the game. kiki pla Ys it with ZZ. The game always starts with kiki. If both play perfectly, who will win the game?
InputInput contains multiple test cases. Each line contains two integer n, m (0 <n, m <= 2000). The input is terminated when n = 0 and m = 0.
OutputIf kiki wins the game printf "Wonderful! ", Else" What a pity! ".
Sample Input
5 35 46 60 0
Sample Output
What a pity! Wonderful! Wonderful!
Author yures
SourceHDU 2007-11 Programming Contest
The square of n * m is given to start from (n, m) to the left or bottom of the left.
Win () and ask who can win
# Include <cstdio> # include <cstring> int main () {int n, m; while (scanf ("% d", & n, & m )! = EOF & (n | m) {if (n % 2 & m % 2) printf ("What a pity! \ N "); else printf (" Wonderful! \ N ") ;}return 0 ;}
Hdu 2147 kiki's game