Problem:
Score : 600 points

Problem Statement

Find the number of sequences of length K consisting of positive integers such that the product of any two adjacent elements is at most N, modulo 10^9+7.

Constraints

1\leq N\leq 10^9

1 2\leq K\leq 100 (fixed at 21:33 JST)

N and K are integers.

Input

Input is given from Standard Input in the following format:

N K

Output

Print the number of sequences, modulo 10^9+7.

Sample Input 1

3 2

Sample Output 1

5

(1,1), (1,2), (1,3), (2,1), and (3,1) satisfy the condition.

Sample Input 2

10 3

Sample Output 2

147

Sample Input 3

314159265 35

Sample Output 3

457397712

Solution in Julia (0.5.0) (judge verdict: Accepted)

parseInt(x) = parse(Int32, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function bsearch(a,x);l,r=0,length(a)+1;while r-l>1;m=(r+l)>>1;if a[m]<x;l=m;else;r=m;end;end;r;end

function main()
	mod = 10^9+7
	n,k = readline() |> split |> parseMap
	sq = floor(Int,sqrt(n))
	t = n+1
	a = Int[]
	for i in 1:sq
		if div(n,i)!=t
			push!(a,i)
			if i!=div(n,i)
				push!(a,div(n,i))
			end
			t = div(n,i)
		end
	end
	a = sort(a)
	m = length(a)
	b = Int[div(n,a[i]) for i in 1:m]
	c = Int[bsearch(a,b[i]) for i in 1:m]
	push!(a,0)
	a = sort(a)
	dp = zeros(Int,k,m)
	for i in 1:m
		dp[1,i] = a[i+1]-a[i]
	end
	tmp = zeros(Int,m)
	for i in 1:k-1
		tmp = zeros(Int,m)
		tmp[m] = dp[i,1]
		for j in 1:m-1
			tmp[m-j] = (tmp[m-j+1]+dp[i,j+1])%mod
		end
		for j in 1:m
			dp[i+1,j] = (tmp[j]*(a[j+1]-a[j]))%mod
		end
	end
	ans = 0
	for i in 1:m
		ans = (ans+dp[k,i])%mod
	end
	println(ans)
end

main()