#P11899. 必胜
必胜
Background
Holmes and Watson are playing a game, but Holmes always wins.
When will Watson realize that the initial positions generated by Holmes always have a guaranteed winning strategy?
Problem Description
Holmes and Watson are playing a math-related game.
Initially, there are integers on the table.
They take turns to act. On a player's turn, they must choose one of the following two operations to perform:
- Choose a number on the table and divide it by its largest prime factor.
- Choose a number on the table and change it to its own square. At any time, the total number of times this player uses this operation cannot exceed their total score.
After a player finishes an operation, if there is a number equal to on the table, remove it and let this player gain point.
Both players start with score . If there are no numbers left on the table, the game ends, and the player with the higher score wins.
Holmes moves first. Assuming both players use optimal strategies, determine who will win, or output a draw.
Input Format
This problem contains multiple test cases.
The first line contains an integer , the number of test cases.
For each test case:
The first line contains an integer , the number of integers on the table.
The second line contains integers , representing the integers on the table.
Output Format
Output lines. Each line contains a string: if the game ends in a draw, output Draw. Otherwise, if Holmes can win, output Lucky_Holmes. Otherwise output Angry_Waston.
3
1
2
2
2 2
1
4
Lucky_Holmes
Draw
Angry_Waston
4
3
9 10 15
3
9 10 30
2
11 14
4
11 4 5 14
Angry_Waston
Lucky_Holmes
Lucky_Holmes
Angry_Waston
3
8
7 12 15 17 21 23 30 31
10
10 11 12 13 14 15 16 17 18 19
6
16 17 18 16 17 18
Angry_Waston
Angry_Waston
Angry_Waston
Hint
Explanation for Sample 1:
There are 3 test cases in total.
In the first test case, there is a single . Holmes can perform operation 1 once to turn into . Watson cannot make any move. Therefore, Holmes wins.
In the second test case, there are two 's. No matter how Holmes plays, he can only eliminate one and get 1 point; Watson can always get 1 point as well, so the result is a draw.
In the third test case, there is only one . After Holmes performs operation 1, Watson moves and scores, so Watson wins.
Explanation for Sample 2
In the first test case, . No matter which number Holmes chooses to operate on, Watson can then perform an operation and score, so Watson wins.
For all testdata, , , .
| # | Special Property | Score |
|---|---|---|
| 0 | 5 | |
| 1 | 10 | |
| 2 | 13 | |
| 3 | 17 | |
| 4 | is prime | 10 |
| 5 | is not prime | 20 |
| 6 | No special restrictions | 25 |
Translated by ChatGPT 5