ll@n,@k,@a[n]; ll l=-1,r=2d14; while(l+1>1; ll o=0,t=0; rep(i,n){ ll j=i+1; ll d=m-(a[i]+o); if(d>0){ ll e=d/+j; t+=e; o+=e*j; } } if(t<=k){ l=m; }else{ r=m; } } wt(l);