from itertools import accumulate N,M = list(map(int,input().split())) A = list(map(int,input().split())) B = list(map(int,input().split())) C = [max(A[i] - B[i],0) for i in range(N)] S = [0] + list(accumulate(C)) ans = 0 for i in range(N-M+1): ans = max(ans, S[i+M] - S[i]) print(ans)