For this Question: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her.

In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N. 

Here, d(M) refers to the sum of all digits of M. For example, d(1023) = 6.The first line consists of a single integer Q – the number of queries.
Then Q lines follow, each line containing a single integer N denoting a query.

<b> Constraints: </b>
1 ≤ Q ≤ 1000
1 ≤ N ≤ 10<sup>18</sup>Print Q lines, the i<sup>th</sup> line containing the answer to the i<sup>th</sup> query.Sample Input 1:
3
1
6
36

Sample Output 1:
1
0
2

Sample Explanation 1:
For the first query, the only possibility is 1.
For the third query, the only possibilities are 6 and 12., I have written this Solution Code: #include <bits/stdc++.h>
 
 
 
using namespace std;
#define int long long
 
 
// #pragma gcc optimize("ofast")
// #pragma gcc target("avx,avx2,fma")
 
 
#define all(x) (x).begin(), (x).end()
 
 
#define pb push_back
#define endl '\n'
#define fi first
#define se second
 
// const int mod = 1e9 + 7;
 
const int mod=998'244'353;
 
 
const long long INF = 2e18 + 10;
// const int INF=4e9+10;
 
#define readv(x, n)   \
    vector<int> x(n); \
    for (auto &i : x) \
        cin >> i;
 
 
 
template <typename t>
    using v = vector<t>;
 
template <typename t>
    using vv = vector<vector<t>>;
 
template <typename t>
    using vvv = vector<vector<vector<t>>>;
 
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<vector<vector<vector<int>>>> vvvvi;
typedef vector<vector<double>> vvd;
 
typedef pair<int, int> pii;
 
 
 
int multiply(int a, int b, int in_mod) { return (int)(1ll * a * b % in_mod); }
int mult_identity(int a) { return 1; }
 
 
 
const double pi = acosl(-1);
 
 
vector<vector<int> > multiply(vector<vector<int>> a, vector<vector<int>> b, int in_mod)
{
    int n = a.size();
    int l = b.size();
    int m = b[0].size();
    vector<vector<int> > result(n,vector<int>(n));
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            for(int k=0;k<l;k++)
            {
                result[i][j] = (result[i][j] + a[i][k]*b[k][j])%in_mod;
            }
        }
    }
    return result;
}
vector<vector<int>> operator%(vector<vector<int>> a, int in_mod)
{
    for(auto &i:a)
        for(auto &j:i)
            j%=in_mod;
    return a;
}
vector<vector<int>> mult_identity(vector<vector<int>> a)
{
    int n=a.size();
    vector<vector<int>> output(n, vector<int> (n));
    for(int i=0;i<n;i++)
        output[i][i]=1;
    return output;
}
 
vector<int> mat_vector_product(vector<vector<int>> a, vector<int> b, int in_mod)
{
    int n =a.size();
 
    vector<int> output(n);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            output[i]+=a[i][j]*b[j];
            output[i]%=in_mod;
        }
    }
    return output;
}
 
 
 
 
auto power(auto a, auto b, const int in_mod)
{
 
    auto prod = mult_identity(a);
    auto mult = a % in_mod;
    while (b != 0)
    {
        if (b % 2)
        {
            prod = multiply(prod, mult, in_mod);
        }
        if(b/2)
        mult = multiply(mult, mult, in_mod);
        b /= 2;
    }
 
    return prod;
}
auto mod_inv(auto q, const int in_mod)
{
    return power(q, in_mod - 2, in_mod);
}
 
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
 
 
#define stp cout << fixed << setprecision(20);
 
 
 
int digit_sum(int x){
    int sm = 0;
    while(x){
        sm += x%10;
        x/= 10;
 
    }
    return sm;
}
 
void solv(){
 
    int n;
    cin>>n;
    int cnt = 0;
    for(int sm = 1;sm<= 200;sm++){
        if(n %sm == 0){
            if( digit_sum(n/sm) == sm){
                cnt++;
 
            }
        }
 
    }
    cout<<cnt<<endl;
 
 
}
 
void solve()
{
 
    int t = 1;
    cin>>t;
    for(int T=1;T<=t;T++)
    {
        // cout<<"Case #"<<T<<": ";
        solv();
    }
}
 
 
 
 
signed main()
{
 
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
 
 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cerr.tie(NULL);
 
    auto clk = clock();
    // -------------------------------------Code starts here---------------------------------------------------------------------
 
    signed t = 1;
    // cin >> t;
 
    for (signed test = 1; test <= t; test++)
    {
        // cout<<"Case #"<<test<<": ";
 
        solve();
    }
 
    // -------------------------------------Code ends here------------------------------------------------------------------
 
    clk = clock() - clk;
 
    #ifndef ONLINE_JUDGE
    cerr << fixed << setprecision(6) << "\nTime: " << ((float)clk) / CLOCKS_PER_SEC << "\n";
    #endif
    return 0;
}
 
/*
000100
 
1000100
 
1 0 -1 -2 -1 -2 -3
*/
, In this Programming Language: C++, Now tell me if this Code is compilable or not?