#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, k, sa = 0;
  cin >> n >> k;
  long long int ar[n], b[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  sort(ar, ar + n);
  long long int h = n / 2;
  long long int p = 1, o = 0;
  for (int i = h + 1; i < n; i++) {
    long long int j = (ar[i] - ar[h]) * p;
    if (k >= j) {
      k = k - j;
      ar[h] += (j / p);
      p++;
      o = i;
    } else
      break;
  }
  if (k > 0) {
    long long int g = k / (p);
    ar[h] += g;
    cout << ar[h];
  } else
    cout << ar[h];
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
