func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 123, mod = 1e9 + 7;   int n, b, p, x;   int cnt[N];   vector<vector<int>> t, a, res;   void add(int& a, int b) {     a = (a + b);     if (a >= mod) {       a -= mod;     }   }   int mult(int a, int b) {     a = (a * 1ll * b) % mod;     return a;   }   vector<vector<int>> mat_mult(const vector<vector<int>>& a,                                const vector<vector<int>>& b) {     vector<vector<int>> c;     c.resize(x, vector<int>(x));     for (int i = 0; i < x; i++) {       for (int j = 0; j < x; j++) {         for (int k = 0; k < x; k++) {           add(c[i][k], mult(a[i][j], b[j][k]));         }       }     }     return c;   }   vector<vector<int>> binpow(int t) {     if (t == 0) return res;     vector<vector<int>> o = binpow(t / 2);     o = mat_mult(o, o);     if (t % 2 == 1) o = mat_mult(o, a);     return o;   }   int main() {     cin >> n >> b >> p >> x;     a.resize(x, vector<int>(x));     res.resize(x, vector<int>(x));     for (int i = 1, val; i <= n; i++) {       cin >> val;       cnt[val]++;     }     for (int i = 0; i < x; i++) {       res[i][i] = 1;     }     for (int i = 0; i < x; i++) {       for (int j = 0; j < 10; j++) {         a[i][(i * 10 + j) % x] += cnt[j];       }     }     res = binpow(b);     cout << res[0][p];   }   