First Blood, Part III
Time Limit: 1 Second Memory Limit: 65536 KB
There is a computer game called First Blood, Part III, which is getting increasingly popular in gaming forums. First Blood, Part III is a two player game, in which players compete to kill a big monster. Ali and Reza decided to play this game. Starting with Ali, he can choose a weapon, and deal damage to the monster. Then it will be turn for Reza to choose its own weapon, and deal damage to the monster. The game continues until the monster is killed, and the player who has killed the monster is the winner.
The monster has an initial hit-point 1< H < 10000, . Each time a player hits the monster with a weapon, monster’s hit-point is reduced. At the end, when the monster’s hit-point becomes less than or equal to 1, the monster dies, and the player with the last hit wins the game.
There are 1 <= W <= 6 kind of weapons which players can choose in each turn. Each weapon is characterized by a value 0 <= Ri <= 0.9. Assuming the monster has the hit-point H, hitting it with the ith weapon reduces its hit-point to H×Ri . For example, if we hit a monster with H = 10 with a weapon with Ri = 0.2 , the remaining hit-point of the monster would be 2.
Ali always starts the game. Determine the winner, assuming that the players do their best to win the game (i.e., they choose optimal weapon in each turn in order to win if possible). Note that in order to avoid rounding problems, we would guarantee that the rounding errors do not change the correct answer.
Input
The first line of the input contains the number of test cases t <= 200, . Each of the following t lines contain the numbers H (the initial hit-point of the monster), W (the number of weapons), and then n numbers R1, R2, ..., R_w, each of them with up to 6 decimals.
Output
For each test case, output the winner according to the format given in the Sample Output.
Sample Input
2 5.1 2 0.25 0.5 9.25 2 0.25 0.5
Sample Output
Reza AliSubmit
Source: 9th Iran Nationwide Internet Contest