Submit | All submissions | Best solutions | Back to list |
SPWORLD - Korra in the Spirit World |
Avatar Korra is trapped in the spirit world and she summons Avatar Aang for help. Avatar Aang who wants to help Avatar Korra first wants to know whether she is intelligent enough to win the ancient game of co-prime Polygons. Two polygons are said to be co-prime if the number of their sides is co-prime. Examples - A 3-sided polygon and a 4-sided polygon are co-prime whereas a 4 sided polygon and a 6 sided polygon are not. The game begins with N polygons. The game has the following rules-
- A player takes any one polygon and cuts it into two co-prime polygons. Cutting is done along a line joining 2 vertices of a polygon (points cannot be adjacent). These 2 new co-prime polygons now become a part of the game. If he/she is not able to perform such a cut on any of polygons he/she loses.
- Avatar Aang takes the first turn. After each cut it is the turn of the other person. In a turn a person can make only one cut.
- Though Aang thinks Korra is not intelligent he is forgetting that she has the wisdom of all the Avatars, even him. So she knows the game. Hence both of them play optimally.
Input
The first line contains the number of test cases (T) followed by T lines each containing a test case. A test case begins with the number N. N integers follow denoting the number of sides in the N polygons. Every polygon will has at least 3 sides.
Output
For each test case output the winner of the game.
Constraints
T<=15, N<=7, 3<=sides of polygon<=1000
Sample Input
2
3 5 6 7
2 6 7
Sample Output
Aang
Korra
Added by: | Saransh Bansal |
Date: | 2012-03-21 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments
2012-05-25 05:57:29 caopeng
Simple SG funtion....But I don't know why I got wa.... Is there anything tricky? Last edit: 2012-05-25 06:29:58 |
|
2012-03-26 20:48:50 Alex Anderson
It is clear from the problem statement what happens if all the values of N are coprime. |
|
2012-03-26 08:42:00 amit kamboj
if all the values of N all co-prime then what will be..plz tell |