from itertools import accumulate N,M=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) AB=[] for _ in range(N): if A[_]-B[_]>=0: AB.append(A[_]-B[_]) else: AB.append(0) RAB=list(accumulate(AB)) MAX=RAB[M-1] for i in range(M,N): MAX=max(MAX,RAB[i]-RAB[i-M]) print(MAX)