N, M = map(int, input().split()) a_list = list(map(int, input().split())) b_list = list(map(int, input().split())) c_list = [] for n in range(N): a = a_list[n] b = b_list[n] c_list.append(max(0, a - b)) res = 0 for m in range(M): res += c_list[m] now = res for n in range(N - M): now -= c_list[n] now += c_list[n + M] res = max(res, now) print(res)