An Amazon warehouse analytics team is reviewing
The score of item
In one operation, the team may choose any one score and increase it by
The team can perform at most
Your task is to find the maximum possible median of the array after performing at most
The median is the element at position
The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the size of the array and the maximum number of operations.
The second line contains KaTeX can only parse string typed expression integers KaTeX can only parse string typed expression — the performance scores.
Print a single integer — the maximum possible median after performing at most KaTeX can only parse string typed expression operations.
Input
5 3
1 3 5 8 9Output8ExplanationAfter sorting, the array is KaTeX can only parse string typed expression. The median position is KaTeX can only parse string typed expression.
Increase KaTeX can only parse string typed expression to KaTeX can only parse string typed expression using KaTeX can only parse string typed expression operations. The array can become KaTeX can only parse string typed expression, so the median is KaTeX can only parse string typed expression.
Example 2:
Input
4 5
1 2 3 4Output4ExplanationFor KaTeX can only parse string typed expression, the median position is KaTeX can only parse string typed expression. To make the median at least KaTeX can only parse string typed expression, increase KaTeX can only parse string typed expression to KaTeX can only parse string typed expression and KaTeX can only parse string typed expression to KaTeX can only parse string typed expression, costing KaTeX can only parse string typed expression operations. Making the median KaTeX can only parse string typed expression would cost KaTeX can only parse string typed expression operations, which is too much.
Example 3:
Input
6 0
7 7 7 7 7 7Output7ExplanationNo operations are allowed, so the median remains KaTeX can only parse string typed expression.