Chocolate Chompers 1
"Poyo!!"
Kirby and King Dedede are playing a game with a bar of chocolate that initially has n rows and m columns.
The players take alternating turns eating the chocolate, with Kirby going first. On a player's turn they can EITHER eat the bottom row of chocolate, OR the rightmost column of chocolate. This means the number of rows or the number of columns of chocolate in the bar reduces by one each turn. The player who eats the last piece of chocolate wins.
Being absolute gluttons, Kirby and King Dedede have played this game many times, and have developed optimal strategies for the game. On certain bars of chocolate, Kirby has a strategy that guarantees that they win, regardless of what King Dedede does. On other bars of chocolates, King Dedede has a strategy that guarantees that he wins, regardless of what Kirby does.
For example, on a 2×2 bar of chocolate, King Dedede can guarantee he wins.
- On the first turn, Kirby eats one row or column, leaving a 1×2 or 2×1 bar of chocolate.
- On Dedede's turn, the chocolate has one row or column, meaning Dedede can eat the entire bar.
It can be shown that for any bar of chocolate either Kirby or King Dedede has a strategy that guarantees they win. Given the dimensions of the bar, find out which player is guaranteed to win.
Input
The input consists of 2 integers. n and m, the number of rows and columns in the chocolate bar.
Output
Print the name of the player who has a strategy that will always win, either Kirby or Dedede.
Constraints
- 1≤n,m≤500
Example 1
2 2
Dedede
Explanation
Regardless of what Kirby does, Dedede can eat the rest of the bar on the second turn.
Example 2
1 50
Kirby
Explanation
If the bar of chocolate has one row or column, then Kirby can just eat it all in one turn.
Example 3
2 3
Kirby
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.