#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); long long N,M; cin>>N>>M; vectorA(N); for(auto &i:A)cin>>i; int ans=0,u=1e9+2; while(u-ans>1){ int mid=(ans+u)/2; long long ad=0; bool ok=true; for(int i=0;i