func_code_string: #include <bits/stdc++.h>   using namespace std;   struct in {     int x, y;   } a[300000];   int get(int prex, int prey, int x, int y, int k) {     int num, ans = 100000000;     if (prex <= k) {       num = (prex + x + k - 1) / k - 1;       if (y == num)         ans = prex + x - num * k;       else if (y > num && y <= (long long)x * k)         ans = 1;     }     if (prey <= k) {       num = (x + k - 1) / k - 1;       if (y == num)         ans = min(ans, x - num * k);       else if (y > num && y - k + prey <= (long long)(x - 1) * k)         ans = 1;     }     return ans;   }   int main() {     int N, K, pre0 = 0, pre1 = 0, next0, next1;     scanf( %d%d , &N, &K);     for (int i = 1; i <= N; i++) scanf( %d , &a[i].x);     for (int i = 1; i <= N; i++) scanf( %d , &a[i].y);     for (int i = 1; i <= N; i++) {       next0 = get(pre0, pre1, a[i].x, a[i].y, K);       next1 = get(pre1, pre0, a[i].y, a[i].x, K);       pre0 = next0;       pre1 = next1;     }     if (pre0 <= K || pre1 <= K)       puts( YES );     else       puts( NO );     return 0;   }   