#include using namespace std; const int kMaxN=1e5+4; unsigned long long n,k,a[kMaxN],minn=LLONG_MAX; bool C(unsigned long long x){ unsigned long long s=0,w=0; for(int i=1;i<=n;i++){ if(a[i]+s>n>>k; for(int i=1;i<=n;i++){ cin>>a[i]; minn=min(minn,a[i]); } unsigned long long l=0,r=minn+k*n; while(l