#P6563. [SBCOI2020] 一直在你身旁
[SBCOI2020] 一直在你身旁
Description
After returning to this town, her new job is to repair electric wires.
Now, one wire is broken. It is known that the wire length is one of . Now, she needs to find out the wire’s length.
She can spend money to buy a wire of length . After buying this wire, she can know whether the required wire length is greater than .
It is guaranteed that .
Ask what is the minimum amount of money she must spend to guarantee that she can determine the required wire length.
Input Format
This problem has multiple test cases.
The first line contains a positive integer , the number of test cases.
Then for each test case: one line contains an integer , and the next line contains integers .
Output Format
Output lines, each line containing one answer.
1
2
1 2
1
Hint
[Sample Explanation]
Buy a wire of length , and you can know whether the required length is greater than . Then you can determine whether it is or , so the answer is .
Large sample link.
[Constraints]
This problem uses bundled testdata, with subtasks in total.
, .
, .
, .
, no additional constraints.
For of the testdata, 。 denotes the sum of over all test cases.
Translated by ChatGPT 5
京公网安备 11011102002149号