#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;xtar) ov += C[j]-tar; FOR(j,N) if(C[j]>B>>N; ll sum=B; FOR(i,N) cin>>C[i], sum+=C[i]; for(i=0;i<=10000;i++) ret[i]=step(i*100000); ll L=0,R=0; for(i=0;i<=10000;i++) { if(ret[L]>ret[i]) L=i; if(ret[R]>=ret[i]) R=i; } ll M=(L+R)*100000/2; ll mi=1LL<<60; for(ll i=L*100000-2000000;i<=R*100000+2000000;i++) mi=min(mi,step(i)); cout<