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