#include using namespace std; int main(){ int N, K; cin >> N >> K; vector A(N), B(N); for(int i=0; i> A[i]; for(int i=0; i> B[i]; vector dp(N); dp[0] = 0; for(int i=1; i= 2) dp[i] = min(dp[i], dp[i-2] + A[i-2] + B[i] + K); } int64_t ans = *max_element(dp.begin(), dp.end()); cout << ans << endl; return 0; }