408133: GYM102993 H Dividing
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
H. Dividingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
The following rules define a kind of integer tuple - the Legend Tuple:
- $$$(1, k)$$$ is always a Legend Tuple, where $$$k$$$ is an integer.
- if $$$(n, k)$$$ is a Legend Tuple, $$$(n + k, k)$$$ is also a Legend Tuple.
- if $$$(n, k)$$$ is a Legend Tuple, $$$(nk, k)$$$ is also a Legend Tuple.
We want to know the number of the Legend Tuples $$$(n, k)$$$ where $$$1 \le n \le N, 1 \le k \le K$$$.
In order to avoid calculations of huge integers, report the answer modulo $$$10^9+7$$$ instead.
InputThe input contains two integers $$$N$$$ and $$$K$$$, $$$1 \le N, K \le 10^{12}$$$.
OutputOutput the answer modulo $$$10^9+7$$$.
ExamplesInput3 3Output
8Input
3 9Output
14