Disk game
Practice
0 (0 votes)
Medium
Ad Hoc
Recruit
Number theory
Ready
Mathematics
Approved
Problem
9% Success 1212 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
RK and Nakul are playing with M disks stored in a box. They will pick disks turn by turn such that the number of disks picked is a power of four.The person who is unable to pick a valid number of disks is declared a loser. If RK goes first, find the winner of the game if both of them play optimally.
Input format
- First line: T
- Each test case: M
Output format
For each test case print "RK", if RK wins, or "Nakul", if Nakul wins
Constraints
1 ≤ T ≤ 1000
1 ≤ M ≤ 1017
Explanation
.
Code Editor
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
Submissions
Please login to view your submissions
Similar Problems
Points:30
Tags:
MathematicsMath BasicBasic MathEasy
Points:30
5 votes
Tags:
MathematicsApprovedEasy-MediumFactorization
Points:20
250 votes
Tags:
ApprovedEasyGreedy AlgorithmsImplementationReady
Editorial
Login to unlock the editorial
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