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())) E = [A[0]] for i in range(1, N): E.append(B[(i-1)%M]+E[-1]) D = defaultdict(int) for i in range(N): D[A[i]-E[i]] += C[i] print(sum(C)-max(D.values()))