#P10812. 【MX-S2-T3】 跳
【MX-S2-T3】 跳
Background
Original problem link: https://oier.team/problems/S2C。

Jump Jump is world No. 1.
No coaching, no apprentices. Find the gap by yourself.
Problem Description
Given a number line with positions from to . From each position , you can jump to (if ), or to (if ), or to one of its divisors. Each position can be visited at most once. Ask how many different ways there are to go from position to position . Output the answer modulo 。
Two ways are different if and only if there exists a jump after which the landing position is different, or there exists a jump whose type is different.
Input Format
One line with two integers 。
Output Format
One line with one integer, the answer modulo 。
3 1000000007
3
4 1000
7
100 511609
272799
Hint
[Sample Explanation #1]
Let denote jumping up or down by , and denote jumping to a divisor. There are ways in total, as follows.
[Sample Explanation #2]
Let denote jumping up or down by , and denote jumping to a divisor. There are ways in total, as follows.
[Constraints]
This problem uses bundled testdata.
- Subtask 0 (8 pts): 。
- Subtask 1 (11 pts): 。
- Subtask 2 (23 pts): 。
- Subtask 3 (26 pts): 。
- Subtask 4 (32 pts): no special constraints。
For all testdata, , 。
Input Format
One line with two integers 。
Output Format
One line with one integer, the answer modulo 。
Translated by ChatGPT 5