#d1101. 二分答案
二分答案
Binary Search on the Answer
Problem Description
You are given a sequence .
You may perform operations on this sequence: in one operation, choose one element and increase it by . After at most operations, you want to maximize the minimum value of the sequence. What is this maximum possible minimum value?
Input Format
The first line contains two integers . The second line contains integers .
Output Format
Output one line containing a single integer: the answer.
Sample Input 1
5 10
1 4 2 6 8
Sample Output 1
5
Sample Input 2
1 10000000000000
100000000
Sample Output 2
10000100000000
Constraints
For of the test cases, , , .
Hint
After finishing this problem, please ask the assistant teacher for the stage test of lesson 26.