#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,H; cin >> N >> H; vector A(N),B(N); for(auto &a : A) cin >> a; for(auto &b : B) cin >> b; long long answer = 0,nowa = 0,nowb = 0,pos = 0,sumb = 0; for(int i=0; i H) break; pos++; nowb = nb; nowa += a; sumb += b; } answer = max(answer,nowa); if(pos == i) pos++; else{ nowa -= A.at(i); nowb -= sumb; sumb -= B.at(i); } } cout << answer << endl; }