#P8980. 「DROI」Round 1 游戏
「DROI」Round 1 游戏
Background
In life, isn’t everything also a game?
Problem Description
You will play games with a child. The rules of each game are as follows:
-
First, you need to choose a positive integer in .
-
Next, the child will make queries. For each query, he will give an (guaranteed that ), and you need to answer the value of .
-
After the child gets the answer in some round, if he can uniquely determine the number you chose, then this game ends.
Now you know in advance the for each query. You need to find an such that the game lasts for as many rounds as possible.
Input Format
This problem has multiple test cases.
The first line contains an integer , indicating the number of games.
For each game:
The first line contains two integers and .
The second line contains integers, where the -th integer represents .
Output Format
For each game, output the maximum number of rounds the game can last. If there exists an such that the child still cannot uniquely determine its value after rounds, output game won't stop.
1
11 3
8 9 5
game won't stop
2
8 5
8 2 3 5 7
24 16
3 17 18 5 19 4 16 23 7 11 13 18 6 21 22 2
5
11
Hint
Sample Explanation #1
Choose as . Obviously, the child cannot uniquely determine until the end of the game.
Sample Explanation #2
For the first test case: choose as . The child can uniquely determine after the fifth round ends. It can be proven that no better exists.
For the second test case: similarly, choosing as is enough.
Constraints
"This problem uses bundled testdata."
-
: .
-
: .
-
: .
-
: no special restrictions.
For of the data: , , , .
The input size is large, so please use a faster input method.
Translated by ChatGPT 5