func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 10 * 1000 + 10, maxm = (1 << 17), mod = (int)1e9 + 7,             hash = 701, inf = (1 << 29) + 3;   const double pi = 3.14159265359, ee = 2.71828;   int dis[30][30], d[(1 << 21)], dd[maxn], l[110], n, m, k, u;   vector<int> q, bf;   void bfs(int v) {     dd[v] = 0, bf.push_back(v);     for (int i = 0; i < bf.size(); i++) {       v = bf[i];       for (int j = 0; j < m; j++) {         if (v + l[j] <= n)           if (dd[v + l[j]] > dd[v] + 1)             dd[l[j] + v] = dd[v] + 1, bf.push_back(v + l[j]);         if (v - l[j] >= 0)           if (dd[v - l[j]] > dd[v] + 1)             dd[v - l[j]] = dd[v] + 1, bf.push_back(v - l[j]);       }     }   }   int main() {     ios::sync_with_stdio(0);     cin >> n >> k >> m;     for (int i = 0; i < k; i++) cin >> u, q.push_back(u), q.push_back(u - 1);     for (int i = 0; i < m; i++) cin >> l[i];     for (int i = 0; i < q.size(); i++) {       for (int j = 0; j <= n; j++) dd[j] = inf;       bfs(q[i]);       for (int j = 0; j < q.size(); j++) dis[i][j] = dd[q[j]];     }     for (int i = 1; i < (1 << q.size()); i++) d[i] = inf, u = 0;     for (int i = 1; i < (1 << q.size()); i++, u = 0) {       while (!(i & (1 << u))) u++;       for (int j = 0; j < q.size(); j++)         if (j != u && (i & (1 << j)))           d[i] = min(d[i], d[i ^ (1 << u) ^ (1 << j)] + dis[u][j]);     }     cout << (d[(1 << q.size()) - 1] == inf ? -1 : d[(1 << q.size()) - 1]) << endl;     return 0;   }   