#include<bits/stdc++.h>
using namespace std;
const int N=200010;
typedef long long ll;
ll n,k,a[N];
bool check(ll mid)
{
ll res=0;
for(int i=n/2;i<n;i++)
{
if(mid>a[i])
{res+=mid-a[i];}
}
return res<=k;
}
int main()
{
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>a[i];
}sort(a,a+n);
ll l=a[n+1/2],r=2e9;
while(l<r)
{
ll mid=(ll)(l+r+1)>>1;
if(check(mid))l=mid;
else
r=mid-1;
}cout<<r<<endl;
}