Search Numbers
Difficulty: Hard

Mohit has just learnt multiplying two integers. Such that
**A(multiply)B=C**.

To make the problem hard he will select *A* in the range *1 to P* and *B* in the range *1 to Q*. Help him to find the number of methods.

Input Format:
First line of the input is the number of test cases *T*. It is followed by T lines. Each line has three space separated integers, the numbers *C*, *P* and *Q*.

Output Format:
For each test case output a single integer, the number of ways.

**Constraints**  
1 <= T <= 50   
1 <= C <= 10^12  
1 <= P <= 10^12  
1 <= Q <= 10^12  

Sample Input:
4  
4 7 9   
5 2 10  
5 5 6  
2 8 1  

Sample Output:
3  
1  
2  
1  

Python 3 starter code:


Reference solution (C++):
<pre>
<p>#include&lt;stdio.h></p>
<p>#include&lt;math.h></p>
void solve(unsigned long long ,unsigned long long ,unsigned long long);  
int main()  
{  
        unsigned long long  N,M,Z;  
        int test_case;  
        scanf("%d",&test_case);  
        while(test_case--)  
        {  
            scanf("%llu",&Z);  
            scanf("%llu",&N);  
            scanf("%llu",&M);  
            solve(N,M,Z);  
        }  
return 0;  
}  
void solve(unsigned long long N,unsigned long long M,unsigned long long Z)  
{  
        unsigned long long number2,no_of_ways=0;  
        int sqrt_val=0,number1;  
        sqrt_val=sqrt(Z);  
        for(number1=1;number1&lt;=sqrt_val;number1++)  
        {  
            number2=Z/number1;   
            if((number2*number1)==Z)  
            {  
                if(number2&lt;=M)  
                {  
                    no_of_ways++;  
                }  
                if(number2&lt;=N && number1!=number2)  
                {  
                    no_of_ways++;  
                }  
            }  
        }  
        printf("%llu\n",no_of_ways);  
} 
</pre>