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())) Bs = [0] for i in range(N - 1): Bs.append(Bs[-1] + B[i % M]) ans = sum(C) sc = ans d = defaultdict(int) for i in range(N): d[A[i] - Bs[i]] += C[i] for x in d: ans = min(ans, sc - d[x]) print(ans)