func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, jj = 0;   long long a[22], b[22];   long long dp[10000][1000];   long long memo(int idx, int cnt) {     long long res = (long long)(1e18);     if (idx == 2 * n - 1) {       if (cnt == 1) res = b[((idx + jj) % n)];       return dp[idx][cnt] = res;     }     if (dp[idx][cnt] != -1) return dp[idx][cnt];     if (cnt > 0) res = b[((idx + jj) % n)] + memo(idx + 1, cnt - 1);     res = min(res, a[((idx + jj) % n)] + memo(idx + 1, cnt + 1));     return dp[idx][cnt] = res;   }   int main() {     memset(dp, -1, sizeof dp);     cin >> n >> m;     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < n; i++) cin >> b[i];     long long mn = memo(0, 0);     long long ans = mn;     for (jj = 1; jj < n; jj++) {       memset(dp, -1, sizeof dp);       mn = min(memo(0, 0), mn);     }     cout << (m / 2 - 1) * mn + ans << endl;     return 0;   }   