from collections import defaultdict, deque from itertools import accumulate n,m=map(int, input().split()) A=list(map(int, input().split())) B=tuple(map(int, input().split())) C=tuple(map(int, input().split())) CA=list(accumulate(C)) if n==2: print(min(C[0] if A[1]-A[0]!=B[0] else 0,C[1] if A[1]-A[0]!=B[0] else 0)) exit() INF=float("inf") S=defaultdict(lambda: INF) if A[1]-A[0]==B[0]: S[A[1]]=min(S[A[1]],0) else: S[A[1]]=min(S[A[1]],C[0]) S[A[0]+B[0]]=min(S[A[0]+B[0]],C[1]) ans=INF for idx in range(2,n): cmin=INF newS=defaultdict(lambda: INF) # print(dict(S)) for prev,cost in S.items(): cmin=min(cmin,cost) if idx==n-1: ans=min(ans,cost+C[-1] if prev+B[(idx-1)%m]!=A[idx] else cost) continue if prev+B[(idx-1)%m]==A[idx]: newS[A[idx]]=min(newS[A[idx]],cost) else: newS[prev+B[(idx-1)%m]]=min(newS[prev+B[(idx-1)%m]],cost+C[idx]) newS[A[idx]]=min(newS[A[idx]],CA[idx-1]) S=newS print(ans)