from collections import defaultdict N, M = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) sums = [0 for _ in range(N + 1)] for i in range(N): sums[i + 1] = sums[i] + B[i % M] sc = sum(C) ans = sum(C) d = defaultdict(int) for i in range(N): d[A[i] - sums[i]] += C[i] for i in range(N): ans = min(ans, sc - d[A[i] - sums[i]]) print(ans)