ll n,k,a[1d5],b[1d5],c,d,e;{rd(n,k,a(n),b(n));rep(i,1,n)(c,d)=(d,min(c+a[i+~(i>1)]+k,d+a[i-1])+b[i]),e>?=d;wt(e);}