NOVICE51 - A Simple Game
Akash and Aayush play the following number game. First they choose a number N (1<=N<=1000000000). Then both of them take their turn one by one. In a turn player has to subtract 1 from the number if it is odd or divide the number by 2 if it is even. Game end when the number becomes zero. Aayush has a dominating nature so he always play first. Help them in finding out who will win the game.
Input
First line contains T, the number of test cases. Following T lines contain 1 integer each, the value of N.
Output
For each test case print "Aayush" if Aayush wins else print "Akash".
Example
Input: 2 468 7547 Output: Aayush Akash
hide comments
bavly morcos:
2013-03-23 20:26:48
<snip> i want to know what is wrong in that code? Last edit: 2023-02-23 10:50:21 |
|
ammar :
2012-11-14 19:35:33
will i use a loop in that code ?? |
|
mohamed nabil mohamed:
2012-11-14 00:17:16
any other test cases!!!!! |
|
sara negm:
2012-07-03 16:10:12
notice that each of aayush and akash will play together for the same number, so that any of them will divide or subtract according to his turn |
|
multisystem:
2012-03-24 14:10:33
Although there is a constraint stating that 1<=N<=1000000000, there is a test case with N=0, and its correct output is "Akash" !!!! |
|
Gandaro:
2012-03-16 18:36:40
You should add the information that the player wins who subtracts or divides last. |
Added by: | Mahesh Chandra Sharma |
Date: | 2011-03-25 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own problem |