from collections import defaultdict N,M=list(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): BS.append(BS[-1]+B[i%M]) mp=defaultdict(int) for (i,a) in enumerate(A): mp[a-BS[i]]+=C[i] s=sum(C) ans=s for (_,v) in mp.items(): ans=min(ans,s-v) print(ans)