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
Submissions
Please login to view your submissions
Similar Problems
Points:30
28 votes
Tags:
Ad-HocApprovedData StructuresEasy
Points:20
2 votes
Tags:
Ad-HocData StructuresReadyApprovedHiringEasy
Points:20
12 votes
Tags:
ApprovedBasic ProgrammingBrute-force searchEasyGreedy AlgorithmsOpenSorting
Editorial