#BS0000074. Trung vị lớn nhất (Maximum Median)
Trung vị lớn nhất (Maximum Median)
Maximum Median
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given an odd-sized integer array, one operation increments one element by one. Using at most operations, maximize the median.
Input
The first line contains . The second line contains the array.
Output
Print the maximum possible median.
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: odd , , .
Example
Input
5 5
1 2 1 1 1
Output
3
Explanation
Five increments are enough to make the median 3, but not 4.