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<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;


const long long int mod = 1000000007, INF = 100000000000000;


//階乗先に計算
long long int kaizyou[200005] = { 1 };
long long int kai(long long int a, long long int b, long long int mod) {
	long long int tmp = 1;
	for (long long int i = a; i <= b; i++) {
		tmp *= i;
		tmp %= mod;

		kaizyou[i] = tmp;
	}
	return tmp;
}


//累乗(繰り返し2乗法)　aのb乗(mod)を求める。
long long int rui(long long int a, long long int b, long long mod) {
	int memo[65] = {};
	long long int A[65] = {};
	long long int tmp = 1;
	for (int i = 0; i < 65; i++) {
		memo[i] = b % 2;
		b /= 2;
	}

	A[0] = a;
	A[0] %= mod;

	for (int i = 1; i < 65; i++) {
		A[i] = A[i - 1] * A[i - 1];
		A[i] %= mod;
	}
	for (int i = 0; i < 65; i++) {
		if (memo[i] == 1) {
			tmp *= A[i];
			tmp %= mod;
		}
	}
	tmp %= mod;
	return tmp;
}

//コンビネーション計算
long long int comb(long long int n, long long int r, long long int mod) {
	long long int tmp;

	tmp = (kaizyou[n] * rui(kaizyou[r], mod - 2, mod)) % mod;
	tmp *= rui(kaizyou[n - r], mod - 2, mod);
	tmp %= mod;
	if (tmp < 0) { tmp = (mod - tmp) % mod; }
	return tmp;
}

//約数列挙 累乗の関数とともに用いる。
long long int soinnsuu[2100000] = {}, yakusuu[2100000] = {1}, kosuu = 1;
int yakusuu_rekkyo(long long int n) {
	long long int N = n;
	for (int i = 2; i * i <= N; i++) {
		int tmp = 1;
		while (n % i == 0) {
			soinnsuu[i]++;
			n /= i;
			tmp++;
		}
		int tmp2 = tmp;

		while (tmp != 1) {
			for (int j = 0; j < kosuu; j++) {
				yakusuu[j + (tmp - 1) * kosuu] = rui(i, tmp - 1, mod) * yakusuu[j];
			}
			tmp--;
		}
		kosuu *= tmp2;

	}
	if (n != 1) {
		for (int j = 0; j < kosuu; j++) {
			yakusuu[j + kosuu] = rui(n, 1, mod) * yakusuu[j];
		}
		kosuu *= 2;
	}
}


long long int n, k, h, w, res = 0, num[200] = {}, sum[200003] = {}, dp[150][70000] = {};
int main() {
	cout << fixed << setprecision(10);
	
	cin >>n>>k;
	yakusuu_rekkyo(n);
	sort(yakusuu, yakusuu + kosuu);
	dp[1][0] = 1;
	for (int i = 1; i<kosuu; i++) {
		dp[1][i] = yakusuu[i]-yakusuu[i-1];
	}
	for (int i = 2; i <= k; i++) {
		for (int j = 0; j < kosuu; j++) {
			long long int memo = 0;
			for (int p = 0; p <= kosuu-j-1; p++) {
				long long int tmp;
				if (j!=0) {
					tmp = dp[i - 1][p] * (yakusuu[j] - yakusuu[j-1]);
				}
				else {
					 tmp = dp[i-1][p];
				}
				tmp %= mod;
				dp[i][j] += tmp;
				dp[i][j] %= mod;
			}

		}
	}

	for (int i = 0; i < kosuu; i++) {
		res += dp[k][i];
	}
	cout << res % mod;

}