func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:128777216 )   const int null = 0;   using namespace std;   template <class T>   int size(const T &a) {     return int(a.size());   }   template <class T>   T abs(const T &a) {     return (a < 0 ? -a : a);   }   template <class T>   T sqr(const T &a) {     return a * a;   }   const int max_n = 52, mod = 1000000007;   int dist[max_n][max_n][2];   int dp[max_n][max_n][2];   bool was[max_n][max_n][2];   struct Pos {     int i, j, s;     int d;     void init(int i, int j, int s, int d) {       this->i = i;       this->j = j;       this->s = s;       this->d = d;       was[i][j][s] = true;       dist[i][j][s] = d;     }   } q[max_n * max_n * 2];   int cmn[max_n][max_n];   int main() {     int n, k;     scanf( %d %d , &n, &k);     for (int i = 0; i <= n; i++) {       cmn[0][i] = 1;     }     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= n; j++) {         cmn[i][j] = cmn[i - 1][j - 1] + cmn[i][j - 1];       }     }     k /= 50;     int c0 = 0, c1 = 0;     for (int i = 0; i < n; i++) {       int t;       scanf( %d , &t);       if (t == 50) {         c0++;       } else {         c1++;       }     }     q[0].init(0, 0, 1, 0);     dp[0][0][1] = 1;     for (int d = 0, u = 1; d < u; d++) {       Pos p = q[d];       int mc0, mc1;       if (p.s) {         mc0 = c0 - p.i;         mc1 = c1 - p.j;       } else {         mc0 = p.i;         mc1 = p.j;       }       long long cnt = dp[p.i][p.j][p.s];       for (int i = 0; i <= mc0; i++) {         for (int j = 0; j <= mc1; j++) {           if (i + j > 0 && i + j * 2 <= k) {             int c0, c1, s0 = p.s ^ 1;             if (p.s) {               c0 = p.i + i;               c1 = p.j + j;             } else {               c0 = p.i - i;               c1 = p.j - j;             }             long long cur = cnt * cmn[i][mc0] % mod * cmn[j][mc1] % mod;             if (!was[c0][c1][s0]) {               q[u++].init(c0, c1, s0, p.d + 1);               dp[c0][c1][s0] = cur;             } else if (p.d + 1 == dist[c0][c1][s0]) {               dp[c0][c1][s0] = (cur + dp[c0][c1][s0]) % mod;             }           }         }       }     }     if (!was[c0][c1][0]) {       printf( -1 n0 n );       return 0;     }     printf( %d n%d n , dist[c0][c1][0], dp[c0][c1][0]);     return 0;   }   