Boring Game
Practice
5 (2 votes)
Easy
Problem
46% Success 1452 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Day 3 of the Test match has just ended, and it seems to be headed for a boring Draw.

Virat and Alastair were very bored and tired of fielding for full days on the ground. They met after the stumps for having a drink. While having the drink, they heard about a new game which they found more interesting than the match that was going on.

So, they decided to play this game on the 4th day, taking a break from the boring game which was going on. Since this game involves each person from the crowd and makes use of the useless 500/1000 rupee notes, everyone agreed to play the game, which is defined as follows :


  1. There are 'n' people in the crowd.
  2. ith person has ai number of notes. (1<=i<=n)
  3. In one move, the player (Virat or Alastair) selects one person, who has more than 1 notes, from the crowd, and takes 'x' number of notes from him, where x divides ai.
  4. The player cannot take all the notes from the person.
  5. Virat plays the first move, after which the two players alternate their turns.
  6. Both the players play optimally.
  7. The player who plays the last move wins the game.

Virat is desperate for a win, but he doesn't have enough time to plan a strategy as he has to give time to his girlfriend. So, he turns to you for help. He gives you the number of people in the crowd, and the number of notes each person is having, and asks you to tell him who will win the game.

Can you help him?


Input :

First line tells the number of test cases, t, then description of the t test cases follow.
The first line of each test case is 'n', the number of people in the crowd.
The next line contains n space separated integers, ai, the number of notes each person has.

Output :

Print "Virat" if Virat wins the game, otherwise, print "Alastair". (without quotes)

Constraints :

1 <= t <= 10
1 <= n <= 1000000
1 <= ai <= 1000000
Sum of n over all the test cases <= 1000000

Problem Setter: Sahil Prakash

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
2 votes
Tags:
MathematicsEasyGame Theory
Editorial

No editorial available for this problem.