func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:102400000,102400000 )   using namespace std;   const int INF = 0x3f3f3f3f;   template <typename X>   inline bool minimize(X& p, X q) {     if (p <= q) return 0;     p = q;     return 1;   }   template <typename X>   inline bool maximize(X& p, X q) {     if (p >= q) return 0;     p = q;     return 1;   }   char str[100];   bool v[10000005];   int a[5005];   int n, kk;   void doit() {     memset(v, 0, sizeof(v));     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       v[a[i]] = 1;     }     int q, x, tmp, left, xx;     scanf( %d , &q);     for (int ii = 1; ii <= q; ii++) {       scanf( %d , &xx);       int ans = 50;       for (int i = 1; i <= n; i++)         for (int j = 0; j <= kk; j++) {           x = xx;           tmp = a[i] * j;           if (x < tmp) continue;           if (x == tmp) {             ans = min(ans, j);             continue;           }           x -= tmp;           left = kk - j;           for (int k = 1; k <= left; k++)             if (x % k == 0) {               if (x / k >= 10000005) continue;               if (v[x / k]) {                 ans = min(ans, j + k);                 break;               }             }         }       if (ans != 50)         printf( %d n , ans);       else         printf( %d n , -1);     }   }   int main() {     while (scanf( %d%d , &n, &kk) != EOF) doit();   }   