func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, k;   int num = 0;   int e[21][21];   int flag[21];   int dfs(int x, int sum, int mid) {     if (x > n) {       num = num + 1;     } else {       mid = dfs(x + 1, sum, mid);       for (int y = 1; y <= n; y++) {         if (num >= k) {           break;         }         if (flag[y] == 0 && e[x][y] != 0 && sum + e[x][y] <= mid) {           flag[y] = 1;           mid = dfs(x + 1, sum + e[x][y], mid);           flag[y] = 0;         }       }     }     return mid;   }   int main() {     int u, v, w;     cin >> n >> m >> k;     for (int i = 0; i <= 20; i++) {       for (int j = 0; j <= 20; j++) {         e[i][j] = 0;       }     }     int l = 0;     int h = n * 1000;     int mid = 0;     for (int i = 0; i < m; i++) {       cin >> u >> v >> w;       e[u][v] = w;     }     while (l < h) {       num = 0;       mid = (l + h) / 2;       mid = dfs(1, 0, mid);       if (num < k) {         l = mid + 1;       } else {         h = mid;       }     }     cout << h << endl;     return 0;   }   