#abc132f. [abc132_f]Small Products
[abc132_f]Small Products
Problem Statement
Find the number of sequences of length consisting of positive integers such that the product of any two adjacent elements is at most , modulo .
Constraints
- 1 (fixed at 21:33 JST)
- and are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of sequences, modulo .
Sample Input 1
3 2
Sample Output 1
5
, , , , and satisfy the condition.
Sample Input 2
10 3
Sample Output 2
147
Sample Input 3
314159265 35
Sample Output 3
457397712