func_code_string: #include <bits/stdc++.h>   using namespace std;   template <class T>   void show(T *a, int n) {     for (int i = 0; i < n; i++) cout << a[i] <<     ;     puts(  );   }   template <class T>   void queue_clear(T *a, int n) {     for (int i = 0; i < n; i++) {       while (!a->empty()) a->pop();     }   }   template <class T>   void Bit_add(T *a, int x, int p, int MAX) {     while (p < MAX) {       a[p] += x;       p += p & (-p);     }   }   template <class T>   T Bit_sum(T *a, int p) {     T ret = 0;     while (p) {       ret += a[p];       p -= p & (-p);     }     return ret;   }   const int MAXN = 1007;   int d[MAXN], s[MAXN];   int main() {     int m, k;     while (~scanf( %d%d , &m, &k)) {       int i;       for (i = 1; i <= m; i++) scanf( %d , d + i);       for (i = 1; i <= m; i++) scanf( %d , s + i);       int tank = s[1], mx = s[1];       int p = 1, ans = 0;       while (p <= m) {         if (tank < d[p]) {           int t = ((d[p] - tank) + mx - 1) / mx;           ans += t * k;           tank += t * mx;         }         tank -= d[p];         ans += d[p];         p++;         mx = max(mx, s[p]);         tank += s[p];       }       printf( %d n , ans);     }     return 0;   }   