func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mxn = 5e3 + 100;   long long dp[25][mxn];   long long arr[mxn];   long long n, k;   bool Check(long long id, long long lo, long long hi, long long rtk) {     while (lo <= hi) {       long long mid = (lo + hi) / 2;       if (dp[id][mid] > rtk)         hi = mid - 1;       else if (dp[id][mid] < rtk)         lo = mid + 1;       else         return true;     }     return false;   }   int main() {     scanf( %lld%lld , &n, &k);     for (int i = 1; i <= n; i++) scanf( %lld , &arr[i]);     sort(arr + 1, arr + n + 1);     for (int i = 1; i <= n; i++) dp[1][i] = arr[i];     for (int i = 2; i <= k; i++) {       for (long long j = 1; j <= n; j++) dp[i][j] = arr[j] * i;     }     long long q;     scanf( %lld , &q);     while (q--) {       long long tk;       scanf( %lld , &tk);       long long mn = 1e9;       long long ans = 0;       for (int i = 1; i <= k; i++) {         for (int j = 1; j <= n; j++) {           long long tmp = dp[i][j];           if (tmp > tk) break;           long long ans = i;           long long rem = k - i;           if (tmp == tk)             mn = min(ans, mn);           else {             for (int jj = 1; jj <= rem; jj++) {               if (Check(jj, j + 1, n, tk - tmp)) {                 mn = min(ans + jj, mn);                 break;               }             }           }         }       }       if (mn == 1e9) mn = -1;       printf( %lld n , mn);     }     return 0;   }   