#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  long long a[n + 1], x = n / 2, y = n / 2;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  a[n] = (long long)1e13;
  ;
  sort(a, a + n);
  while (k > 0) {
    while (a[x] == a[y]) {
      y++;
    }
    if (k > (a[y] - a[x]) * (y - x)) {
      k -= (a[y] - a[x]) * (y - x);
      a[x] = a[y];
    } else {
      long long m = k / (y - x);
      cout << a[x] + m;
      k = 0;
    }
  }
  return 0;
}
