#abc236h. [abc236_h]Distinct Multiples
[abc236_h]Distinct Multiples
Problem Statement
Given are positive integers , , and a sequence of positive integers .
Find the number of sequences of positive integers that satisfy the following conditions, modulo .
- For each , is a multiple of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 7
2 3 4
Sample Output 1
3
The three sequences that satisfy the conditions are .
Sample Input 2
3 3
1 2 2
Sample Output 2
0
No sequence satisfies the conditions.
Sample Input 3
6 1000000000000000000
380214083 420492929 929717250 666796775 209977152 770361643
Sample Output 3
325683519
Be sure to find the count modulo .