A Coin Game
Practice
4.7 (3 votes)
Mathematics
Medium
Open
Approved
Game theory
Problem
42% Success 2996 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Rahul and Rashi are bored with playing the game of Nim, particularly after Rahul gained a thorough understanding of game theory, and would always win.

Now, they are going to play on a variation.
There are only 2 piles of coins. Each player can make the following move:

  • Pick K ( ≥ 1) coins from pile 1.
  • Pick K ( ≥ 1) coins from pile 2.
  • Pick K ( ≥ 1) coins from pile 1 as well as pile 2.

As with the older version, the person unable to make a move shall lose. Can you help analyse this game for the novice, Rashi.

Input Format:

The first line contains an integer T, denoting the number of test cases to follow.
The next T lines each contain two integers N1 and N2, separated by a single space, denoting sizes of first pile and second pile respectively.

Output Format:

The output file should contain exactly T lines.
Output Play, if Rashi would win as the first player and Don't Play, if she shall lose.

Constraints:

1 ≤ T ≤ 105
0 ≤ N1, N2 ≤ 106

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
44 votes
Tags:
MathematicsMediumOpenApprovedGame Theory
Points:30
Tags:
MediumAlgorithmsMathematicsOpenApprovedGame Theory
Points:30
1 votes
Tags:
MediumAlgorithmsMathematicsOpenApprovedGame Theory