func_code_string: #include <bits/stdc++.h>   using namespace std;   const int sz = 2e5;   int n, k;   long long add[sz], cost[sz], pre[sz], suf[sz], mnpre[sz], mnsuf[sz],       bestSufTake[sz], bestSufTakeFromPre[sz];   void input() {     cin >> n >> k;     for (int i = 0; i < n; i++) cin >> add[i];     for (int i = 0; i < n; i++) cin >> cost[i];   }   void initPreSuf() {     for (int i = 0; i < n; i++) pre[i] = add[i] + (i ? pre[i - 1] : 0);     for (int i = n - 1; i >= 0; i--)       suf[i] = add[i] + (i != n - 1 ? suf[i + 1] : 0);     for (int i = 0; i < n; i++)       mnpre[i] = (i ? min(mnpre[i - 1], cost[i]) : cost[i]);     for (int i = n - 1; i >= 0; i--)       mnsuf[i] = (i != n - 1 ? min(mnsuf[i + 1], cost[i]) : cost[i]);     for (int i = n - 1; i >= 0; i--)       bestSufTake[i] = max(bestSufTake[i + 1], suf[i] - cost[i]);     for (int i = 0; i < n; i++) {       if (!i)         bestSufTakeFromPre[i] = suf[i] - cost[i];       else         bestSufTakeFromPre[i] = max(bestSufTakeFromPre[i - 1], suf[i] - cost[i]);     }   }   void solveZero() { cout << max(0LL, bestSufTake[0]) << endl; }   void solveEven() {     long long bst = max(0LL, bestSufTake[0]);     for (int i = 0; i < n - 1; i++) bst = max(bst, pre[n - 1] - cost[i]);     cout << bst << endl;   }   void solveOne() {     long long bst = max(0LL, bestSufTake[1]);     for (int i = 1; i < n - 1; i++)       bst = max(bst, pre[i] - mnpre[i] + bestSufTake[i + 1]);     for (int i = 1; i < n - 1; i++)       bst = max(bst, max(bestSufTakeFromPre[i - 1] - add[i], bestSufTake[i + 1]) +                          max(0LL, add[i] - cost[i]));     cout << bst << endl;   }   void solveOdd() {     long long bst = max(0LL, bestSufTake[1]);     long long best = add[0] - cost[0];     for (int i = n - 2; i >= 0; i--) {       if (i == 1) continue;       bst = max(bst, pre[n - 1] - cost[i]);     }     if (n == 4) {       bst = max(bst, pre[n - 1] - cost[1]);       bst = max(bst, pre[n - 1] - cost[0]);     } else {       bst = max(bst, pre[n - 1] - add[n - 1] - cost[1]);       for (int i = 0; i < n; i++) {         if (i == 1 || i == 2) continue;         bst = max(bst, pre[n - 1] - add[i] - cost[1]);       }     }     cout << bst << endl;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     input();     initPreSuf();     if (k == 0)       solveZero();     else if (k == 1)       solveOne();     else if (k % 2 == 0)       solveEven();     else       solveOdd();     return 0;   }   