Maximize the Minimum
JJ has an array
of size . He can perform the following operations on the array at mosttimes:
- Set
He wants to maximize the value of the minimum element of the array
. Formally, he wants to maximize the value of.
Can you help him do so?
Input Format
- The first line contains a single integer
- .
Output Format
For each test case, output the maximum value of the minimum element of the array
that can be obtained after applying the given operation at mosttimes.
Constraints
Sample Input 1
4
5 4
5 4 3 2 1
6 1
8 2 3 9 6 10
5 2
4 3 4 3 5
5 1000
4 3 4 3 5
Sample Output 1
5
3
4
5
Explanation
Test Case 1: We can perform the following operations (in the following order):
- Set
Therefore the answer is
.
Test Case 2: We can perform the following operations (in the following order):
- Set
Therefore the answer is
.
Test Case 3: We can perform the following operations (in the following order):
- Set
Therefore the answer is
.
Comments
Post a Comment