#P3321. [SDOI2015] 序列统计
[SDOI2015] 序列统计
Description
Xiao C has a set whose elements are non-negative integers less than . He wrote a sequence generator that can generate a sequence of length , where every term belongs to the set .
Xiao C generated many such sequences. However, he needs your help with the following question: given an integer , count how many different sequences can be generated such that the product of all numbers in the sequence equals .
Xiao C considers two sequences and different if and only if . Since the answer may be large, he only needs the answer modulo .
Input Format
One line with four integers , where is the number of elements in the set .
The second line contains integers, representing all elements of the set .
Output Format
Output a single integer on one line, representing the answer.
4 3 1 2
1 2
8
Hint
Sample explanation:
The different sequences that can be generated and satisfy the requirement are , , , , , , , .
Constraints:
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, , , .
is a prime, and the input guarantees that the elements in set are distinct.
Translated by ChatGPT 5
京公网安备 11011102002149号