#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
long long int modInverse(long long int a) { return power(a, 1000000007 - 2); }
const int N = 100001;
bool vis[N];
vector<int> adj[N];
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
long long int binaryNum[32];
void decToBinary(long long int n) {
  binaryNum[32] = {0};
  int i = 0;
  while (n > 0) {
    binaryNum[i] = n % 2;
    n = n / 2;
    i++;
  }
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<long long int> diff(n / 2 + 1);
  for (long long int i = 0; i < n / 2 + 1; i++) {
    if (i == 0) {
      diff[i] = 0;
    } else {
      long long int ind = n / 2 + i;
      diff[i] = a[ind] - a[ind - 1];
    }
  }
  long long int med = a[n / 2];
  long long int fin = 0;
  for (long long int i = 0; i < n / 2 + 1; i++) {
    fin = i;
    if (k == 0) {
      break;
    }
    if (diff[i] > 0) {
      if (i * diff[i] <= k) {
        med += diff[i];
        k -= i * diff[i];
      } else {
        med += k / (i);
        k -= (k / (i)) * i;
        break;
      }
    }
  }
  if (fin == n / 2) {
    if (k > 0) {
      med += k / ((n / 2 + 1));
    }
  }
  cout << med;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  int t = 0;
  while (t++ < T) {
    solve();
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
}
