Status:  Past  Start:  20111201 14:00:00  End:  20111201 19:10:00 
The Caribbean Training Contest #29
Problem
1646  Coins on a Board
Created by  Carlos Julio Figueiras Carrera 
Added by  ymondelo20 (20111129) 
Limits 
Total Time: 500 MS
Memory: 62 MB  Output: 64 MB  Size:
29 KB

Enabled languages  
Available in 
Description
Andrea and Vida are two girls who love games. This time they were very boring and your Dad bought them a new game to have fun together. The game board consists of an N+1 squares numbered from 0 to N. The rules are very simple, initially there will be M coins placed on the board in positions not necessarily different. On each turn, take a coin and make a play with it. A play is to move at least one square to the left of the current position. The game ends when all the coins are in the 0 position of the board and win the girl who move the last coin to that position. Your task is to determine which girl wins the game if they play optimally alternating plays. Vida is always the first to make a play.
Andrea and Vida are two girls who love games. This time they were very boring and your Dad bought them a new game to have fun together. The game board consists of an N+1 squares numbered from 0 to N. The rules are very simple, initially there will be M coins placed on the board in positions not necessarily different. On each turn, take a coin and make a play with it. A play is to move at least one square to the left of the current position. The game ends when all the coins are in the 0 position of the board and win the girl who move the last coin to that position. Your task is to determine which girl wins the game if they play optimally alternating plays. Vida is always the first to make a play.
Andrea and Vida are two girls who love games. This time they were very boring and your Dad bought them a new game to have fun together. The game board consists of an N+1 squares numbered from 0 to N. The rules are very simple, initially there will be M coins placed on the board in positions not necessarily different. On each turn, take a coin and make a play with it. A play is to move at least one square to the left of the current position. The game ends when all the coins are in the 0 position of the board and win the girl who move the last coin to that position. Your task is to determine which girl wins the game if they play optimally alternating plays. Vida is always the first to make a play.
Input specification
Several tests cases, and for each test case two lines:
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Several tests cases, and for each test case two lines:
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Several tests cases, and for each test case two lines:
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Output specification
For each case print one line with one string “Vida” if win the first girl, else print “Andrea”.
For each case print one line with one string “Vida” if win the first girl, else print “Andrea”.
Several tests cases, and for each test case two lines:
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Line 1: Two spaceseparated integer M and N; 1 <= M <= 50 and 1 <= N <= 20.
Line 2: M spaceseparated integer numbers (V1, V2, …, VM); 0 <= Vi <= N for 1 <= i <= M.
Sample input
1 5
1
2 5
1 1
Sample output
Vida
Andrea
Hint(s)
http://coj.uci.cu/contest/
http://coj.uci.cu/contest/
http://coj.uci.cu/contest/