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: 
q = int(input())

for _ in range(q):

    n = int(input())
    count = 0

    for i in range(1,9*len(str(n))):

        if not n % i:

            dig = n//i

            if sum(map(int,str(dig))) == i:
                count += 1
    
    print(count), In this Programming Language: Python, Now tell me if this Code is compilable or not?