n, x = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) INF = 10**18 s = sum(A) dp = [[INF]*(s+1) for i in range(n+1)] dp[0][0] = 0 for a, b in zip(A, B): for j in reversed(range(n)): for k in reversed(range(s+1)): if dp[j][k] == INF: continue dp[j+1][k+a] = min(dp[j+1][k+a], dp[j][k]) dp[j][k] += b ans = INF for j in range(1, n+1): for k in range(s+1): if k >= x*j: ans = min(ans, dp[j][k]) if ans != INF: print(ans) else: print(-1)