from collections import defaultdict # 入力 N, M = map(int, input().split()) A_list = list(map(int, input().split())) B_list = list(map(int, input().split())) C_list = list(map(int, input().split())) # 入力値チェック assert 1 <= M <= N <= 2 * 10**5 assert all([-10**9 <= a <= 10**9 for a in A_list]) assert all([-10**9 <= b <= 10**9 for b in B_list]) assert all([1 <= c <= 10**9 for c in C_list]) # 解く sum_cost = sum(C_list) cnt = 0 exempted_costs = defaultdict(int) for i, (a, c) in enumerate(zip(A_list, C_list)): cnt += B_list[(i - 1) % M] exempted_costs[cnt - a] += c # 徴収が免除される最大のコスト max_exempted_cost = 0 for exempted in exempted_costs.values(): max_exempted_cost = max(exempted, max_exempted_cost) # 総コスト - 免除コスト print(sum_cost - max_exempted_cost)