#abc276g. G - Count Sequences
G - Count Sequences
Score : points
问题陈述
找出满足以下条件的整数序列 的个数,对 取模。
- 。
- 对于每个 ,当 除以 的余数与 除以 的余数不相同时。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Find the number of sequences of integers with terms, , that satisfy the following conditions, modulo .
- .
- For each , the remainder when is divided by is different from the remainder when is divided by .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 4
Sample Output 1
8
Here are the eight sequences that satisfy the conditions.
Sample Input 2
276 10000000
Sample Output 2
909213205
Be sure to find the count modulo .
update @ 2024/3/10 11:38:29