#include <bits/stdc++.h>
using namespace std;
ifstream fin("aa.txt");
int dp[1050];
int d[1050];
int s[1050];
int res[1050];
int main() {
  int m, k;
  cin >> m >> k;
  (memset((d), (0), sizeof(d)));
  (memset((s), (0), sizeof(s)));
  (memset((dp), (0x1f), sizeof(dp)));
  (memset((res), (0), sizeof(res)));
  dp[0] = 0;
  for (int i = 1; i <= m; i++) {
    cin >> d[i];
    d[i] += d[i - 1];
  }
  for (int i = 0; i < m; i++) {
    cin >> s[i];
  }
  res[0] = s[0];
  for (int i = 0; i < m; i++) {
    int r = res[i];
    int pt = 0;
    for (int j = i + 1; j <= m; j++) {
      int t = (d[j] - d[i] - r) / s[i];
      if (t * s[i] < d[j] - d[i] - r) t++;
      t = ((t) > (pt) ? (t) : (pt));
      pt = t;
      if (dp[j] > dp[i] + d[j] - d[i] + t * k) {
        dp[j] = ((dp[j]) < (dp[i] + d[j] - d[i] + t * k)
                     ? (dp[j])
                     : (dp[i] + d[j] - d[i] + t * k));
        res[j] = t * s[i] - d[j] + d[i] + r + s[j];
      } else if (dp[j] == dp[i] + d[j] - d[i] + t * k) {
        res[j] = ((res[j]) > (t * s[i] - d[j] + d[i] + r + s[j])
                      ? (res[j])
                      : (t * s[i] - d[j] + d[i] + r + s[j]));
      }
      r += s[j];
    }
  }
  cout << dp[m] << endl;
  return 0;
}
