Ensure that you are logged in and have the required permissions to access the test.

Is it a Cakewalk

0

0 votes
Hard
Problem

Vikram and Amrit have n plastic blocks. 
They label the blocks with sequential numbers from 1 to n and begin playing a game in turns, 
with Vikram always taking the first turn. The rules are :

For each turn, the player removes 2 blocks, A and B, from the set. 
They calculate A-B, write the result on a new block, and insert the new block into the set.
The game ends when only 1 block is left. The winner is determined by the value on the final block, X:

If X%3 = 1, then Vikram wins.
If X%3=2, then Amrit wins.
else, the player who moved last wins.

Given the value of n, can you find and print the name of the winner? Assume that both play optimally.

Note: The selection order for A and B matters, 
as sometimes (A-B) != (B-A).An example is where N=5. If A=2 and B=3, 
then the newly inserted block is labeled -1; alternatively, if A=3 and B=2, 
the newly inserted block is labeled 1.

Input Format

The first line contains a single positive integer, T the number of test cases. 
The next T lines contain an integer, n.

Constraints

1<=T<=1000
1<=N<=100000

Output Format

For each test case, print the name of the winner (Either Vikram or Amrit) in a new line.
 

Sample Input
2
2
3
Sample Output
Vikram
Amrit
Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?