#include #define syosu(x) fixed< P; typedef pair pdd; typedef pair pll; typedef vector vi; typedef vector vvi; typedef vector vd; typedef vector vvd; typedef vector vl; typedef vector vvl; typedef vector vs; typedef vector

vp; typedef vector vvp; typedef vector vpll; typedef pair pip; typedef vector vip; const int inf=1<<30; const ll INF=1ll<<60; const double pi=acos(-1); const double eps=1e-9; const ll mod=1e6+7; const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0}; ll m,n; vl a; int main(){ cin>>m>>n; a=vl(n); for(int i=0;i>a[i]; sort(a.begin(),a.end()); ll l=0,r=inf; while(r-l>1){ ll M=(l+r)/2,t=m; for(auto i:a) t+=i-M; if(t>=0) l=M; else r=M; } if(a[n/2]