Decompose into a Product
Time limit2sMemory limit512 MB
Given m as a product of n factors (n ≤ 500, each up to 1e9), count ordered n-tuples of positive integers whose product is m, modulo 1e9+9.
- Level
Medium7 of 10
- Topics
- Number theory, Combinatorics, Math, Prefix sum
- Solved
- No attempts yet
Problem
A natural number is given as the product of natural numbers. Count the ways to decompose into natural numbers. The numbers you write down must multiply back to , and two decompositions that use the same elements in a different order count as different ways.
For example, if and , there are four decompositions: , , , .
The numbers given in the input also count as one decomposition. The count grows very large, so print it modulo .
Input
The first line contains a natural number ().
The second line contains natural numbers separated by spaces. Each of them is at most .
Output
Print the number of ways to decompose , modulo , on the first line.