from bisect import bisect_left import sys sys.setrecursionlimit(10**6) INF = 1 << 62 N, S = map(int, input().split()) X = list(map(int, input().split())) W = list(map(int, input().split())) memo = {} def f(p, w, l, r): if l == 0 and r == N-1: return 0 if (p, w, l, r) in memo: return memo[p, w, l, r] res = INF w2 = w - W[p] if p == l: if l > 0: d = X[p] - X[p-1] res = min(res, w2 * d + f(l-1, w2, l-1, r)) if r+1 < N: d = X[r+1] - X[p] res = min(res, w2 * d + f(r+1, w2, l, r+1)) if p == r: if l > 0: d = X[p] - X[l-1] res = min(res, w2 * d + f(l-1, w2, l-1, r)) if r+1 < N: d = X[r+1] - X[p] res = min(res, w2 * d + f(r+1, w2, l, r+1)) memo[p, w, l, r] = res return res ans = INF w = sum(W) p = bisect_left(X, S) if p > 0: d = S - X[p-1] ans = min(ans, w * d + f(p-1, w, p-1, p-1)) d = X[p] - S ans = min(ans, w * d + f(p, w, p, p)) print(ans)