#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 50;
const int INF = 0x3f3f3f3f;
long long a[maxn];
long long n, m;
long long cnt[maxn];
long long z[maxn];
int main() {
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    cnt[i] = 0;
  }
  sort(a + 1, a + n + 1);
  int now = a[1];
  int ind = 0;
  int cha = 0;
  int flag = 0;
  long long nowans;
  for (int i = 1; i <= n; i++) {
    if (flag) {
      if (a[i] == now && ind != 0) {
        cnt[ind]++;
      } else {
        ind++;
        cnt[ind]++;
        z[ind] = a[i] - now;
        now = a[i];
      }
    }
    if (i == n / 2 + 1) {
      z[0] = 0;
      now = a[i];
      flag = 1;
      nowans = a[i];
    }
  }
  z[++ind] = INF;
  int nowind = 0;
  long long nownum = 1;
  while (m > 0) {
    if (z[nowind + 1] * nownum > m) {
      long long tmpadd = m / nownum;
      nowans += tmpadd;
      break;
    } else {
      m -= z[nowind + 1] * nownum;
      nowind++;
      nownum += cnt[nowind];
      nowans += z[nowind];
    }
  }
  printf("%lld\n", nowans);
}
