Arrays where each element divides the next
Count the arrays of length K whose values are all between 1 and N and in which every element divides the next one. Print the count modulo 10^9 + 7.
Reported in: Infosys (SP / DSE · earlier papers) (memory-based)
Input
One line: N and K.
Output
The number of arrays modulo 10^9 + 7.
Constraints
1 ≤ N ≤ 10^5; 1 ≤ K ≤ 100.
Example 1
Input:
3 2
Output:
5Example 2
Input:
2 3
Output:
4Example 3
Input:
6 3
Output:
25Hint: Let ways[v] be the number of arrays so far that end in v. To add an element, add ways[v] to every multiple of v. That loop costs about N·log N, so the whole count is about K·N·log N.