<p>You are given a 2D integer array, <code>queries</code>. For each <code>queries[i]</code>, where <code>queries[i] = [n<sub>i</sub>, k<sub>i</sub>]</code>, find the number of different ways you can place positive integers into an array of size <code>n<sub>i</sub></code> such that the product of the integers is <code>k<sub>i</sub></code>. As the number of ways may be too large, the answer to the <code>i<sup>th</sup></code> query is the number of ways <strong>modulo</strong> <code>10<sup>9</sup> + 7</code>.</p>

<p>Return <em>an integer array </em><code>answer</code><em> where </em><code>answer.length == queries.length</code><em>, and </em><code>answer[i]</code><em> is the answer to the </em><code>i<sup>th</sup></code><em> query.</em></p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> queries = [[2,6],[5,1],[73,660]]
<strong>Output:</strong> [4,1,50734910]
<strong>Explanation:</strong>&nbsp;Each query is independent.
[2,6]: There are 4 ways to fill an array of size 2 that multiply to 6: [1,6], [2,3], [3,2], [6,1].
[5,1]: There is 1 way to fill an array of size 5 that multiply to 1: [1,1,1,1,1].
[73,660]: There are 1050734917 ways to fill an array of size 73 that multiply to 660. 1050734917 modulo 10<sup>9</sup> + 7 = 50734910.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> queries = [[1,1],[2,2],[3,3],[4,4],[5,5]]
<strong>Output:</strong> [1,2,3,10,5]
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= queries.length &lt;= 10<sup>4</sup> </code></li>
	<li><code>1 &lt;= n<sub>i</sub>, k<sub>i</sub> &lt;= 10<sup>4</sup></code></li>
</ul>

//Pure mathematics 
//JEE MATHS
//No dp nothing
//https://www.youtube.com/watch?v=fyGNoJKQBRs&t

#define ll long long
#define pb push_back
#define MOD 1000000007
class Solution {
public:
    ll f(ll num,ll pow,ll mod){
        if(pow==0)return 1;
        ll a =f(num,pow/2,MOD);
        if(pow%2==1){
            return (((num*a)%MOD)*a)%MOD;
        }else{
            return (a*a)%MOD;
        }
    }
    vector<int> waysToFillArray(vector<vector<int>>& q) {
        vector<ll>fct(2e4+3);
        vector<ll>inv(2e4+3);
        vector<ll>seive(2e4+3);
        vector<ll>prime(2e4+3);
        for(ll i=2;i<=2e4+2;i++){
            for(ll j=2*i;j<=2e4+2;j=j+i){
                seive[j]=1;
                if(seive[i]==0)prime[j]=i;
            }
            if(seive[i]==0)prime[i]=i;
        }
        fct[0]=1;
        fct[1]=1;
        inv[0]=1;
        inv[1]=1;
        
        for(ll i=2;i<=2e4+2;i++){
            fct[i]=(fct[i-1]*i)%MOD;
            inv[i]=f(fct[i],MOD-2,MOD);
        }

        vector<int>ans(q.size());
        for(ll i=0;i<q.size();i++){
            ll num = q[i][1];
            ll iu = q[i][0];
            map<ll,ll>mp;
            while(num!=1){
                mp[prime[num]]++;
                num=num/prime[num];
            }
            vector<ll>opi;
            for(auto it:mp)opi.pb(it.second);

            ll val = 1;
            for(ll j=0;j<opi.size();j++){
               
                val=(((((val*fct[opi[j]+iu-1])%MOD)*inv[opi[j]])%MOD)*inv[iu-1])%MOD;
            }
            ans[i]=val;
        }

        return ans;
    }
};
95200