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 C++14 (Clang 3.8.0) (judge verdict: Time Limit Exceeded)

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    Int N, K;
    vector<vector<Int>> dpf;
    vector<vector<Int>> dpg;

    Int modadd(Int a, Int b) {
        return (a + b) % MOD;
    }

    Int f(Int k, Int x) {
        if (x * x > N) {
            return g(k, N / x);
        }
        if (k == 1) return 1;

        if (dpf[k][x] != -1) return dpf[k][x];
        Int ret = 0;
        for (Int i = 1; i * i <= N; ++i) {
//            ret += f(k - 1, i);
            ret = modadd(ret, f(k - 1, i));
        }

//        for (Int i = x; (i + 1) * (i + 1) <= N; ++i) {
        for (Int i = x; i * i < N; ++i) {
            if ((N / i) * (N / i) <= N) continue;
            Int kei = (N / i - N / (i + 1));
            Int tmp = kei * g(k - 1, i) % MOD;
//            ret += tmp;
            ret = modadd(ret, tmp);
        }

        return dpf[k][x] = ret;
    }

    Int g(Int k, Int x) {
        if (k == 1) return 1;
        if (dpg[k][x] != -1) return dpg[k][x];

        Int ret = 0;
//        Int ret = f(k, N / x);
        for (Int i = 1; i <= x; ++i) {
            ret = modadd(ret, f(k - 1, i));
        }


        return dpg[k][x] = ret;

    }

    void solve() {
        cin >> N >> K;
        dpf.resize(K + 1, vector<Int>(round(sqrt(N)) + 1, -1));
        dpg.resize(K + 1, vector<Int>(round(sqrt(N)) + 1, -1));

        Int ans = 0;
        for (Int i = 1; i * i <= N; ++i) {
            ans = modadd(ans, f(K, i));
        }
//        for (Int i = 1; (i + 1) * (i + 1) <= N; ++i) {
        for (Int i = 1; i * i < N; ++i) {
            if ((N / i) * (N / i) <= N) continue;
            Int kei = (N / i - N / (i + 1));
            Int tmp = kei * g(K, i) % MOD;
            ans = modadd(ans, tmp);
        }

        cout << ans << endl;

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}