func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long N = 50;   long long fac[N + 1];   void init() {     fac[0] = 1;     for (long long i = 1; i <= N; i++) {       fac[i] = (i * fac[i - 1]) % 1000000007LL;     }   }   long long pw(long long a, long long e) {     if (e == 0) {       return 1;     }     long long ret = pw(a, e / 2);     ret = (ret * ret) % 1000000007LL;     if (e % 2 == 1) {       ret = (a * ret) % 1000000007LL;     }     return ret;   }   long long choose(long long x, long long y, long long x0, long long y0) {     return (((((fac[x] * pw(fac[x0], 1000000007LL - 2)) % 1000000007LL) *               pw(fac[x - x0], 1000000007LL - 2)) %              1000000007LL) *             ((((fac[y] * pw(fac[y0], 1000000007LL - 2)) % 1000000007LL) *               pw(fac[y - y0], 1000000007LL - 2)) %              1000000007LL)) %            1000000007LL;   }   long long X, Y;   vector<pair<long long, long long> > adj[(N + 1) * (N + 1) * 2];   long long getVertex(long long x, long long y, long long sh) {     return sh * (X + 1) * (Y + 1) + x * (Y + 1) + y;   }   queue<long long> q;   long long dist[(N + 1) * (N + 1) * 2], ways[(N + 1) * (N + 1) * 2];   int main() {     init();     long long n, k;     cin >> n >> k;     while (n--) {       long long w;       cin >> w;       if (w == 50) {         X++;       } else {         Y++;       }     }     for (long long x = 0; x <= X; x++) {       for (long long y = 0; y <= Y; y++) {         for (long long x0 = 0; x0 <= x; x0++) {           for (long long y0 = 0; y0 <= y; y0++) {             if (x0 + y0 >= 1 && (50 * x0 + 100 * y0 <= k)) {               long long w = choose(x, y, x0, y0);               adj[getVertex(x, y, 0)].push_back(pair<long long, long long>(                   getVertex(X - x + x0, Y - y + y0, 1), w));               adj[getVertex(x, y, 1)].push_back(pair<long long, long long>(                   getVertex(X - x + x0, Y - y + y0, 0), w));             }           }         }       }     }     long long start = getVertex(X, Y, 0), end = getVertex(X, Y, 1);     for (long long u = 0; u <= (X + 1) * (Y + 1) * 2 - 1; u++) {       dist[u] = 1000000000000000000LL;     }     q.push(start);     dist[start] = 0;     ways[start] = 1;     while (!q.empty()) {       long long u = q.front();       q.pop();       for (pair<long long, long long> vw : adj[u]) {         long long v = vw.first, w = vw.second;         if (dist[u] + 1 < dist[v]) {           q.push(v);           dist[v] = dist[u] + 1;           ways[v] = (ways[u] * w) % 1000000007LL;         } else if (dist[u] + 1 == dist[v]) {           ways[v] = (ways[v] + ways[u] * w) % 1000000007LL;         }       }     }     cout << (dist[end] == 1000000000000000000LL ? -1 : dist[end]) <<   n           << ways[end] <<   n ;   }   