N, M = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) S = [0] for (a,b) in zip(A,B): nxt = S[-1] + max(a-b, 0) S.append(nxt) ans = 0 for i in range(N-M+1): tmp = S[i+M] - S[i] ans = max(ans, tmp) print(ans)