#abc236h. Ex - Distinct Multiples
Ex - Distinct Multiples
Score : points
问题描述
给定正整数 、 和一个正整数序列 。
求满足以下条件的正整数序列 的个数,结果对 取模。
- 对于每个 ,有 是 的倍数。
以上为通义千问 qwen-max 翻译,仅供参考。
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 .
update @ 2024/3/10 10:14:52