#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } template vector fusion(vector bs,Ts... ts){ auto append=[&](auto vs){for(auto v:vs) bs.emplace_back(v);}; initializer_list{(void(append(ts)),0)...}; return bs; } //INSERT ABOVE HERE const Int LOG = 20; const Int MAX = 1e5 + 100; Int nx[LOG][MAX]; signed main(){ cin.tie(0); ios::sync_with_stdio(0); Int n,m; cin>>n>>m; auto as=read(n); auto rs=fusion(as,as); vector sm(2*n+1); for(Int i=0;i<2*n;i++) sm[i+1]=sm[i]+rs[i]; auto check=[&](Int d)->Int{ for(Int i=0;i<=2*n;i++) nx[0][i]=lower_bound(sm.begin(),sm.end(),sm[i]+d)-sm.begin(); for(Int k=0;k>k)&1) j=nx[k][j]; // cout<>1; if(check(M)) L=M; else R=M; } cout<