#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int a[200000];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long int add = 0;
  long long int mul = 1;
  long long int flag = 0;
  long long int mid = n / 2;
  for (long long int i = n / 2; i < n - 1; i++) {
    long long int dif = a[i + 1] - a[i];
    if (k >= mul * dif) {
      k = k - mul * dif;
      add += dif;
      mul++;
    } else {
      flag = 1;
      add += k / mul;
      break;
    }
  }
  if (flag == 1) {
    cout << a[mid] + add << endl;
    return 0;
  }
  long long int steps = n / 2 + 1;
  add += k / steps;
  cout << a[mid] + add << endl;
}
