SOLVE

LATER

Boring Game

Problem

Editorial

Analytics

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 :

- There are 'n' people in the crowd.
- i
^{th}person has a_{i}number of notes. (1<=i<=n) - 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 a**._{i} - The player
**cannot take all the notes**from the person. - Virat plays the first move, after which the two players alternate their turns.
- Both the players play
**optimally**. - 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, a_{i}, 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 <= a_{i} <= 1000000

Sum of n over all the test cases <= 1000000

Problem Setter: Sahil Prakash

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Kotlin,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic

Initializing Code Editor...

{"b687e95": "/pagelets/suggested-problems/algorithm/boring-game-1/", "ffcd55a": "/pagelets/show-submission/algorithm/boring-game-1/", "f8a7185": "/pagelets/problem-author-tester/algorithm/boring-game-1/", "7835133": "/pagelets/problems-hint/algorithm/boring-game-1/", "e9f1ff3": "/pagelets/recommended-problems/algorithm/boring-game-1/"}

realtime.hackerearth.com

80

45a8dde3e062c441d4798e516942850347b15280

58a29e5cae2309f04b28

/realtime/pusher/auth/