n, x = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) INF = 10**18 s = sum(A) from collections import defaultdict dp = defaultdict(lambda: INF) dp[(0, 0)] = 0 for a, b in zip(A, B): nx = defaultdict(lambda: INF) for (i, j), v in dp.items(): nx[(i+1, j+a)] =min(nx[(i+1, j+a)], v) nx[(i, j)] = v+b dp = nx ans = INF for (i, j), v in dp.items(): if i == 0: continue if j >= x*i: ans = min(ans, v) if ans != INF: print(ans) else: print(-1)