3312.On Number of Decompositions into Multipliers

Time Limit: 1s Memory Limit: 256MB

You are given an integer m as a product of integers a1,a2,... an 3312_1.png. Your task is to find the number of distinct decompositions of number m into the product of n ordered positive integers.Decomposition into n products, given in the input, must also be considered in the answer. As the answer can be very large, print it modulo 1000000007 (109+7).

Input Format(From the terminal/stdin)

Input The first line contains positive integer n (1 \le n \le 500). The second line contains space-separated integers a1,a2,...,an (1 \le ai \le 109).

Output Format(To the terminal/stdout)

Output In a single line print a single number k - the number of distinct decompositions of number m into n ordered multipliers modulo 1000000007 (109+7).

Sample Input 1

Copy
1
15
 \n
  \n

Sample Output 1

Copy
1
 \n

Sample Input 2

Copy
3
1 1 2
 \n
 · · \n

Sample Output 2

Copy
3
 \n

Sample Input 3

Copy
2
5 7
 \n
 · \n

Sample Output 3

Copy
4
 \n

Hints

In the second sample, the get a decomposition of number 2, you need any one number out of three to equal 2, and the rest to equal 1.In the third sample, the possible ways of decomposing into ordered multipliers are [7,5], [5,7], [1,35], [35,1].A decomposition of positive integer m into n ordered multipliers is a cortege of positive integers b={b1,b2,... bn} such that 3312_2.png. Two decompositions b and c are considered different, if there exists index i such that bi \neq ci.

Submit

请先 登录

© 2025 FAQs