atcoder#ABC236H. [ABC236Ex] Distinct Multiples
[ABC236Ex] Distinct Multiples
Score : points
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.
3 7
2 3 4
3
The three sequences that satisfy the conditions are .
3 3
1 2 2
0
No sequence satisfies the conditions.
6 1000000000000000000
380214083 420492929 929717250 666796775 209977152 770361643
325683519
Be sure to find the count modulo .