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