New Nim Game
Practice
3.7 (3 votes)
Easy
Problem
6% Success 134 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Karan and Arjun like to play strange games.This time they play the following game: they have \(n\) stone piles,\(i^{th}\) of which contains \(a_i\) stones. Players move one after other .
Each player in his turn can split \(each\space pile\) that contains two or more stones into two non-empty parts.

Note:- It is compulsory to divide a pile in two parts if its size is greater than 1.

A player loses,if each stone pile has 1 stone, as he will not be able to divide any of stone pile in two non-empty piles. 

Karan moves first. Determine who will win if both players play optimally.
Input : -

First line contains \(T\) , no. of testcases.
The first line contains the only integer \(n\)  number of stone piles on the table.
The second line contains \(n\) space-separated integers \(a_1,a_2,a_3, \dots a_n\) numbers of stones in the piles.
Output : -
For each test case Print "Karan" if Karan will win, and "Arjun"  if the winner will be Arjun.

Constraints : -

\(1 \leq T \leq 10\)

\(1 \leq n \leq 100 \)

\(1 \leq a_i \leq 10^9\)

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:20
1 votes
Tags:
EasyMathGame Theory
Points:20
36 votes
Tags:
EasyLogic-BasedGame TheoryNIMMathematics
Editorial

No editorial available for this problem.