func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, x;   int cnt[100], b[105][105], sol[105][105], c[105][105], a[105][105];   inline void Mult_Mat(int a[][105], int b[][105]) {     int i, j, k, s;     for (i = 0; i < x; ++i)       for (j = 0; j < x; ++j) {         s = 0;         for (k = 0; k < x; ++k)           s = (1LL * s + 1LL * a[i][k] * b[k][j]) % 1000000007;         c[i][j] = s;       }     for (i = 0; i < x; ++i)       for (j = 0; j < x; ++j) a[i][j] = c[i][j];   }   inline void Pow_Log(int a[][105], int p) {     int i, j;     for (i = 0; i < x; ++i) sol[i][i] = 1;     while (p) {       if (p & 1) {         --p;         Mult_Mat(sol, a);       }       p >>= 1;       Mult_Mat(a, a);     }     for (i = 0; i < x; ++i)       for (j = 0; j < x; ++j) a[i][j] = sol[i][j];   }   int main() {     int i, j, B, k, xx;     cin.sync_with_stdio(0);     cin >> n >> B >> k >> x;     for (i = 1; i <= n; ++i) {       cin >> xx;       ++cnt[xx];     }     for (i = 0; i < x; ++i)       for (j = 0; j < 10; ++j)         b[i][(i * 10 + j) % x] = (b[i][(i * 10 + j) % x] + cnt[j]) % 1000000007;     Pow_Log(b, B);     a[1][0] = 1;     Mult_Mat(a, b);     cout << a[1][k] <<   n ;     return 0;   }   