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 LuaJIT (2.0.4) (judge verdict: Accepted)

local mod = 1000000007
local mfl = math.floor
local function badd(x, y)
  return (x + y) % mod
end
local function bmul(x, y)
  local x0, y0 = x % 31623, y % 31623
  local x1, y1 = mfl(x / 31623), mfl(y / 31623)
  return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end

local mfl, msq = math.floor, math.sqrt
local function solve(n, k)
  local sq = 1 + mfl(msq(n))
  if n < sq * sq then sq = sq - 1 end
  local stage = {}
  for i = 1, sq do
    stage[i] = 1
  end
  local sum = sq
  if sq * (sq + 1) <= n then
    table.insert(stage, mfl(n / sq) - sum)
    sum = sum + stage[sq + 1]
  end
  for i = sq - 1, 1, -1 do
    table.insert(stage, mfl(n / i) - sum)
    sum = sum + stage[#stage]
  end
  local dp1, dp2 = {}, {}
  for i = 1, #stage do
    dp1[i] = stage[i]
  end
  for ik = 2, k do
    local src = ik % 2 == 0 and dp1 or dp2
    local dst = ik % 2 == 0 and dp2 or dp1
    local tsum = 0
    for i = #stage, 1, -1 do
      tsum = badd(tsum, src[#stage - i + 1])
      dst[i] = bmul(stage[i], tsum)
    end
  end
    local ret = 0
  if k % 2 == 0 then
    for i = 1, #stage do
      ret = badd(ret, dp2[i])
    end
  else
    for i = 1, #stage do
      ret = badd(ret, dp1[i])
    end
  end
  return ret
end

local n, k = io.read("*n", "*n")
print(solve(n, k))