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 (GCC 5.4.1) (judge verdict: Wrong Answer)

//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int N, K;
int sum[2][100010];
int num[100010];

signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N >> K;

	int pre = -1;
	int C = 0;
	
	vector<int> tn;
	int ts = 0;
	rrep(i, 1, (int)sqrt(N) + 1)
	{
		if (pre == -1 && i == 1)
		{
			tn.push_back(N / i - 1);
			ts += N / i - 1;
		}
		if (pre != -1)
		{
			tn.push_back(N / i - pre);
			ts += N / i - pre;
		}
		pre = N / i;
	}

	rep(i, 0, N - ts)
	{
		num[C] = 1;
		C++;
	}
	rep(i, 0, SZ(tn))
	{
		num[C] = tn[i];
		C++;
	}

	rep(j,0,C)sum[1][j] = 1;

	int t;
	rep(i, 0, K)
	{
		rep(j, 0, C)
		{
			t = (sum[(i + 1) % 2][C - j - 1] * num[j]) % MOD;
			sum[i % 2][j] = t;
			if (0 < j)sum[i % 2][j] = (sum[i % 2][j] + sum[i % 2][j - 1]) % MOD;
		}
	}

	cout << sum[(K - 1) % 2][C - 1] << endl;

	return 0;
}