You are given a list of queries.
Each query is a pair [n, k], meaning:
• n = the length of the array to create
• k = the product that all numbers in the array must multiply to
Find how many different arrays of length n (containing only positive integers)
have a product exactly equal to k.
Because the result can be very large, return the answer for each query modulo
10⁹ + 7.
Input: queries = [[2,6],[5,1],[73,660]]
Output: [4,1,50734910]
Explanation:
• [2,6]: 4 arrays multiply to 6 → [1,6], [6,1], [2,3], [3,2]. • [5,1]: Only 1 array works → [1,1,1,1,1]. • [73,660]: There are 1,050,734,917 valid arrays. After taking modulo 1,000,000,007, the answer is 50,734,910.
Input: queries = [[1,1],[2,2],[3,3],[4,4],[5,5]]
Output: [1,2,3,10,5]
Explanation:
• [1,1] → 1 way: [1] • [2,2] → 2 ways: [1,2], [2,1] • [3,3] → 3 ways • [4,4] → 10 ways • [5,5] → 5 ways
Accepted:
Submission: