Problem:
M: プレゼント (Presents)
白羽さんは、とある悪魔にサプライズプレゼントとして次のような集合を用意した。
$N$ 以下の異なる $K$ 個の自然数からなる
どの 2 つの値の組を集合から選んでも、片方の数がもう片方の数で割り切れる
実はこのような集合には悪魔の力を奪う性質があり、このままだと力を失ってしまう。
悪魔を助けるために、このような集合がいくつあるか計算せよ。
入力
2 つの整数 $N, K$ が空白区切りで与えられる。
出力
条件を満たす集合の個数を出力せよ。
制約
$N$ は $1$ 以上 $100 \ 000$ 以下の整数
$K$ は $1$ 以上 $N$ 以下の整数
入力例1
6 3
出力例1
3
集合 $(1,2,4), (1,2,6), (1,3,6)$ が条件を満たす。
入力例2
100000 7
出力例2
58848855
$N = 100 \ 000, K = 7$ のとき、条件を満たす集合は $58 \ 848 \ 855$ 通りある。

Submitted solutions:

code_snippet: #include <bits/stdc++.h>

/*
*/

using namespace std;
//make -f ../makefile SRC=


/*
TODO: top down dp
*/

//------------------------------------------------------------------------------
bool DEBUG = false;

const int64_t MOD = 1000000007L;
const int MAX_K = 17;
const int MAX_N = 100000;
static int64_t S[MAX_K][MAX_N+1]; // k, ends in

const int MAX_V = 100000;
static bool is_prime[MAX_V+1];
static int SPF[MAX_V+1];

//------------------------------------------------------------------------------
void sieve_of_eratosthenes()
{
    is_prime[0] = false;
    is_prime[1] = false;

    for (int i=2; i<=MAX_V; i++) is_prime[i] = true;

    for (int i=2; i*i<=MAX_V; i++)
    {
        if (is_prime[i])
        {
            for (int j=2*i; j<=MAX_V; j+=i) is_prime[j] = false;
        }
    }


    SPF[1] = 1;
    for (int i=2; i<=MAX_V; i++) SPF[i] = i;

    for (int i=4; i<=MAX_V; i+=2) SPF[i] = 2;

    for (int i=3; i*i<=MAX_V; i++)
    {
        if (SPF[i] != i) continue;
        for (int j=i*i; j<=MAX_V; j+=i)
            if (SPF[j] == j)
                SPF[j] = i;
    }

}

//------------------------------------------------------------------------------
int max_factors_spf(int x)
{
    if (x == 1) return 1;
    int res = 0;
    while (x != 1)
    {
        x = x / SPF[x];
        res++;
    }
    res++;
    return res;
}
//------------------------------------------------------------------------------
vector<int> divisors(int v)
{
    vector<int> D;

    for (int i=2; i*i<=v; i++) //<---------- exclude 1 and v
    {
        if (v%i == 0)
        {
            if (v/i != i) { D.push_back(i); D.push_back(v/i); }
            else D.push_back(i);
        }
    }

    //sort(D.begin(), D.end(), greater<int64_t>());
    return D;
}
//------------------------------------------------------------------------------
void test()
{
    for (int d: divisors(6)) printf("%d\n",6/d);
    return;

    int N = 24;
    for (int v=2; v<=N; ++v)
    {
        printf("max_factors_spf=%d\n", max_factors_spf(v));
        printf("v=%d: ",v); for (int x: divisors(v)) printf("%d ",x); printf("\n");
        printf("\n");
    }
}

//------------------------------------------------------------------------------
// top down dp
int64_t dp(int N, int K, int k, int v)
{
    if (S[k][v] != -1) return S[k][v];

    int64_t& res = S[k][v];
    if (max_factors_spf(v) < k+1 || (k > 1 && is_prime[v])) { res = 0; return res; }

    res = 0;
    for (int d: divisors(v)) res += dp(N, K, k-1, v/d);
    res += dp(N, K, k-1, 1);

    return res;
}

//------------------------------------------------------------------------------
int64_t solve(int N, int K)
{
    if (DEBUG) printf("N=%d, K=%d\n", N, K);
    //--------------------------------------------------------------------------
    // base cases:
    if (K == 1) return N;
    else if (K > MAX_K || max_factors_spf(N) < K) return 0;
    //--------------------------------------------------------------------------
    // init:
    for (int k=0; k<K; ++k) for (int i=0; i<=N; ++i) S[k][i] = -1;
    for (int i=1; i<=N; ++i) S[0][i] = 1;

    int64_t res = 0;
    int L = pow(2, K-1);
    if (DEBUG) printf("L=%d\n", L);
    for (int v=L; v<=N; ++v) res += dp(N, K, K-1, v);

    if (DEBUG)
    {
        for (int k=0; k<K; ++k)
            for (int i=0; i<=N; ++i)
                if (S[k][i] != -1)
                    printf("k=%d, i=%d, S=%ld\n", k, i, S[k][i]);
    }
    return res;
}

//------------------------------------------------------------------------------
int main()
{
    //DEBUG = true;
    sieve_of_eratosthenes();
    //test(); return 0;
    //--------------------------------------------------------------------------
    int N, K, num;
    num = scanf("%d %d ", &N, &K);
    int64_t res = solve(N, K);
    printf("%ld\n", res);
    //--------------------------------------------------------------------------
    return 0;
}
//------------------------------------------------------------------------------
accuracy: 0.2
time_ms: 20
memory_kb: 6688
final_rank: 20

code_snippet: #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using std::cout;
using std::cin;
using std::endl;
using ll=long long;
using ld=long double;
ll ILL=2167167167167167167;
const int INF=2100000000;
const ll mod=1e9+7;
#define rep(i,a) for (ll i=0;i<a;i++)
#define all(p) p.begin(),p.end()
template<class T> using _pq = priority_queue<T, vector<T>, greater<T>>;
template<class T> ll LB(vector<T> &v,T a){return lower_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> ll UB(vector<T> &v,T a){return upper_bound(v.begin(),v.end(),a)-v.begin();}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}else return 0;}
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}else return 0;}
template<class T> void So(vector<T> &v) {sort(v.begin(),v.end());}
template<class T> void Sore(vector<T> &v) {sort(v.begin(),v.end(),[](T x,T y){return x>y;});}
void yneos(bool a){if(a) cout<<"Yes\n"; else cout<<"No\n";}
template<class T> void vec_out(vector<T> &p){for(int i=0;i<(int)(p.size());i++){if(i) cout<<" ";cout<<p[i];}cout<<"\n";}
template<class T> T min(vector<T> &a){assert(!a.empty());T ans=a[0];for(auto &x:a) chmin(ans,x);return ans;}
template<class T> T max(vector<T> &a){assert(!a.empty());T ans=a[0];for(auto &x:a) chmax(ans,x);return ans;}
template<class T> T sum(vector<T> &a){assert(!a.empty());T ans=a[0]-a[0];for(auto &x:a) ans+=x;return ans;}

void solve();
// oddloop
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t=1;
	//cin>>t;
	rep(i,t) solve();
}

void solve(){
	int N,K;
	cin>>N>>K;
	if(K>20){
		cout<<"0\n";
		return;
	}
	ll ans=0;
	vector<vector<ll>> dp(N+1,vector<ll>(K+1));
	rep(i,N+1){
		if(i==0) continue;
		dp[i][1]=1;
		for(int j=i*2;j<=N;j+=i){
			for(int k=1;k<K;k++){
				dp[j][k+1]+=dp[i][k];
			}
		}
		ans+=dp[i][K];
	}
	cout<<ans<<"\n";
}
accuracy: 1
time_ms: 30
memory_kb: 21464
final_rank: 9

code_snippet: #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

int main()
{
    ll n, k;
    cin >> n >> k;
    if (k > 30) {
        cout << 0 << endl;
        return 0;
    }

    vector<vector<ll>> vviDP(n + 1, vector<ll>(k + 1, 0));
    vviDP[1][1] = 1;
    for (ll i = 2; i <= n; i++) {
        vviDP[i][1] = 1;
        vector<ll> viDivide;
        viDivide.reserve(1000);
        for (ll j = 1; j*j <= i; j++) {
            if (i%j != 0) {
                continue;
            }
            viDivide.push_back(j);
            if (j != 1 && j*j != i) {
                viDivide.push_back(i / j);
            }
        }
        for (ll j = 0; j < viDivide.size(); j++) {
            for (ll m = 1; m < k; m++) {
                vviDP[i][m + 1] += vviDP[viDivide[j]][m];
            }
        }
    }

    ll nAns = 0;
    for (ll i = 1; i <= n; i++) {
        nAns += vviDP[i][k];
    }
    cout << nAns << endl;
    return 0;
}
accuracy: 1
time_ms: 140
memory_kb: 21456
final_rank: 13

code_snippet: #include <bits/stdc++.h>
using namespace std;

using ll = long long;

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

  int n, k;
  cin >> n >> k;

  if (k > 17) {
    cout << 0 << '\n';
    return 0;
  }

  vector<vector<ll>> dp(k + 1, vector<ll>(n + 1));
  for (int j = 1; j <= n; j++) dp[1][j] = 1;
  for (int i = 1; i < k; i++) {
    for (int j = 1; j <= n; j++) {
      for (int kk = 2 * j; kk <= n; kk += j) {
        dp[i + 1][kk] += dp[i][j];
      }
    }
  }

  ll ans = 0;
  for (int j = 1; j <= n; j++) ans += dp[k][j];
  cout << ans << '\n';
}
accuracy: 1
time_ms: 10
memory_kb: 15648
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;

using ll = long long;

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

  int n, k;
  cin >> n >> k;

  if (k >= 17) {
    cout << 0 << '\n';
    return 0;
  }

  vector<vector<ll>> dp(k + 1, vector<ll>(n + 1));
  for (int j = 1; j <= n; j++) dp[1][j] = 1;
  for (int i = 1; i < k; i++) {
    for (int j = 1; j <= n; j++) {
      for (int kk = 2 * j; kk <= n; kk += j) {
        dp[i + 1][kk] += dp[i][j];
      }
    }
  }

  ll ans = 0;
  for (int j = 1; j <= n; j++) ans += dp[k][j];
  cout << ans << '\n';
}
accuracy: 0.8
time_ms: 10
memory_kb: 15608
final_rank: 19

code_snippet: #include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace std;
 
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, int> pii;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
 
 
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
 
#define MOD 1000000007
 
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) {if (a < b) {a = b; return true;} return false;}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) {if (a > b) {a = b; return true;} return false;}
const double EPS = 1e-8, PI = acos(-1);
const double pi = 3.141592653589793238462643383279;
//ここから編集    
typedef string::const_iterator State;
ll GCD(ll a, ll b){
  return (b==0)?a:GCD(b, a%b);
}
ll LCM(ll a, ll b){
  return a/GCD(a, b) * b;
}
template< int mod >
struct ModInt {
  int x;
 
  ModInt() : x(0) {}
 
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
 
  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }
 
  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
 
  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }
 
  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }
 
  ModInt operator-() const { return ModInt(-x); }
 
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
 
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
 
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
 
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
 
  bool operator==(const ModInt &p) const { return x == p.x; }
 
  bool operator!=(const ModInt &p) const { return x != p.x; }
 
  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
 
  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
 
  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }
 
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }
 
  static int get_mod() { return mod; }
};
 
using modint = ModInt< 998244353 >;
template< typename T >
struct Combination {
  vector< T > _fact, _rfact, _inv;
 
  Combination(int sz) : _fact(sz + 1), _rfact(sz + 1), _inv(sz + 1) {
    _fact[0] = _rfact[sz] = _inv[0] = 1;
    for(int i = 1; i <= sz; i++) _fact[i] = _fact[i - 1] * i;
    _rfact[sz] /= _fact[sz];
    for(int i = sz - 1; i >= 0; i--) _rfact[i] = _rfact[i + 1] * (i + 1);
    for(int i = 1; i <= sz; i++) _inv[i] = _rfact[i] * _fact[i - 1];
  }
 
  inline T fact(int k) const { return _fact[k]; }
 
  inline T rfact(int k) const { return _rfact[k]; }
 
  inline T inv(int k) const { return _inv[k]; }
 
  T P(int n, int r) const {
    if(r < 0 || n < r) return 0;
    return fact(n) * rfact(n - r);
  }
 
  T C(int p, int q) const {
    if(q < 0 || p < q) return 0;
    return fact(p) * rfact(q) * rfact(p - q);
  }
 
  T H(int n, int r) const {
    if(n < 0 || r < 0) return (0);
    return r == 0 ? 1 : C(n + r - 1, r);
  }
};
 
ll modpow(ll x, ll n, ll mod) {
  ll res = 1;
  x %= mod;
  if(x == 0) return 0;
  while(n) {
    if(n&1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
} 
inline long long mod(long long a, long long m) {
    return (a % m + m) % m;
}
template<typename T> 
struct BIT{
  int N;
  std::vector<T> node;
  BIT(){}
  BIT(int n){
    N = n;
    node.resize(N+10);
  }
  void build(int n) {
    N = n;
    node.resize(N+10);
  }
  /* a: 1-indexed */
  void add(int a, T x){
    for(int i=a; i<(int)node.size(); i += i & -i) node[i] += x;
  }

  /* [1, a] */
  T sum(int a){
    T res = 0;
    for(int x=a; x>0; x -= x & -x) res += node[x];
    return res;
  }

  /* [l, r] */
  T rangesum(int l, int r){
    return sum(r) - sum(l-1);
  }

  /* 
    a1+a2+...+aw >= valとなるような最小のwを返す
    @verify https://codeforces.com/contest/992/problem/E
  */
  int lower_bound(T val) {
    if(val < 0) return 0;

    int res = 0;
    int n = 1; 
    while (n < N) n *= 2;

    T tv=0;
    for (int k = n; k > 0; k /= 2) {
      if(res + k < N && node[res + k] < val){
        val -= node[res+k];
        res += k;
      }
    }
    return res+1; 
  }
};
struct UnionFind{
  std::vector<int> par;
  std::vector<int> siz;

  UnionFind(int sz_): par(sz_), siz(sz_) {
    for(int i=0; i<sz_; ++i) par[i] = i, siz[i] = 1;
  }

  void init(int sz_){
    par.resize(sz_);
    siz.resize(sz_);
    for(int i=0; i<sz_; ++i) par[i] = i, siz[i] = 1;
  }

  int root(int x){
    if(x == par[x]) return x;
    return par[x] = root(par[x]);
  }

  bool merge(int x, int y){
    x = root(x), y = root(y);
    if(x == y) return false;
    if(siz[x] < siz[y]) std::swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }

  bool issame(int x, int y){
    return root(x) == root(y);
  }

  int size(int x){
    return siz[root(x)];
  }
};
struct RollingHash{

    using ull = unsigned long long;
    const ull mod = (1ULL << 61) - 1;
    const ull MASK30 = (1ULL << 30) - 1;
    const ull MASK31 = (1ULL << 31) - 1;

    const ull MASK61 = mod;

    ull base;
    int n;
    vector<ull> hash, pow;

    RollingHash(const string &s)
    {
        random_device rnd;
        mt19937_64 mt(rnd());
        base = 1001;
        
        n = (int)s.size();
        hash.assign(n+1, 0);
        pow.assign(n+1, 1);
        
        for(int i=0; i<n; i++){
            hash[i+1] = calc_mod(mul(hash[i], base) + s[i]);
            pow[i+1] = calc_mod(mul(pow[i], base));
        }
    }

    ull calc_mod(ull x){
        ull xu = x >> 61;
        ull xd = x & MASK61;
        ull res = xu + xd;
        if(res >= mod) res -= mod;
        return res;
    }

    ull mul(ull a, ull b){
        ull au = a >> 31;
        ull ad = a & MASK31;
        ull bu = b >> 31;
        ull bd = b & MASK31;
        ull mid = ad * bu + au * bd;
        ull midu = mid >> 30;
        ull midd = mid & MASK30;
        return calc_mod(au * bu * 2 + midu + (midd << 31) + ad * bd);
    }

    //[l,r)のハッシュ値
    inline ull get(int l, int r){
        ull res = calc_mod(hash[r] + mod*3-mul(hash[l], pow[r-l]));
        return res;
    }
    //string tのハッシュ値
    inline ull get(string t){
        ull res = 0;
        for(int i=0; i<t.size(); i++){
            res = calc_mod(mul(res, base)+t[i]);
        }
        return res;
    }
    //string s中のtの数をカウント
    inline int count(string t) {
        if(t.size() > n) return 0;
        auto hs = get(t);
        int res = 0;
        for(int i=0; i<n-t.size()+1; i++){
            if(get(i, i+t.size()) == hs) res++; 
        }
        return res;
    }

    /* 
        concat 
        @verify https://codeforces.com/problemset/problem/514/C
    */
    inline ull concat(ull h1, ull h2, int h2len){
      return calc_mod(h2 + mul(h1, pow[h2len]));
    }

    // LCPを求める S[a:] T[b:]
    inline int LCP(int a, int b){
        int len = min((int)hash.size()-a, (int)hash.size()-b);
        
        int lb = -1, ub = len;
        while(ub-lb>1){
            int mid = (lb+ub)/2;

            if(get(a, a+mid) == get(b, b+mid)) lb = mid;
            else ub = mid;
        }
        return lb;
    }
};
ll dp[30][101010];
int main() {  
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  
  int n, k; cin >> n >> k;
  if(k >= 25) {
    cout << 0 << endl;
    return 0;
  }
  REP(i,30) REP(j,101010) dp[i][j] = 0;
  for(int i=1; i<=n; i++) dp[1][i] = 1;

  for(int i=1; i<=n; i++) {
    for(int j=2*i; j<=n; j+=i) {
      for(int l=26; l>=1; l--) {
        if(dp[l][i] == 0) continue;
        dp[l+1][j] += dp[l][i];
      }
    }
  }
  ll ans = 0;
  REP(i,n+1) if(dp[k][i]!=-1)ans += dp[k][i];
  cout << ans << endl;
  return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 27112
final_rank: 10

code_snippet: #include <bits/stdc++.h>
using namespace std;

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll INF = 1e9+10;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

ll dp[100100][25]; // 最後にiをおいたとき、j個となるような通り数

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  
  ll n,k; cin>>n>>k;
  
  reps(i,n) dp[i][1]=1;
  
  reps(i,n){
    irep(j,1,20){
      for(ll l=2; i*l<=n; l++){
        dp[i*l][j+1]+=dp[i][j];
      }
    }
  }
  
  ll ans=0;
  reps(i,n) ans+=dp[i][k];
  cout<<ans<<endl;
  
}
accuracy: 1
time_ms: 80
memory_kb: 22560
final_rank: 12

code_snippet: #include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){

  int n,k; cin >> n >> k;

  static int dp[101010][21]; //iが最大でj個の集合の数
  for(int i = 1; i <= n; i++) dp[i][1] = 1;
  for(int i = 2; i <= n; i++){
    for(int j = 1; j*j <= i; j++){
      if(i%j == 0){
        for(int k = 1; k < 20; k++){
          dp[i][k+1] += dp[j][k];
          if(j*j == i || j == 1) continue;
          dp[i][k+1] += dp[i/j][k];
        }
      }
    }
  }

  int ans = 0;
  for(int i = 1; i <= n; i++){
    ans += dp[i][k];
  }
  cout << ans << endl;

  return 0;
}
accuracy: 1
time_ms: 240
memory_kb: 19304
final_rank: 14

code_snippet: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<functional>
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
using namespace std;
int count(int x){
    int i = 1;
    while(x){
        ++i;
        x /= 2;
    }
    return i;
}
int main(){
    int N,K;
    cin >> N >> K;
    if(count(N) < K){
        cout << 0 << endl;
        return 0;
    }
    vector<long long> line(N+1,1);
    long long ans = 0;
    REP(i,K){
        for(int j = N;j>=1;--j){
            for(int k = j * 2;k<=N;k+=j){
                line[k] += line[j];
            }
            if(i+1==K)ans+=line[j];
            line[j] = 0;
        }
    }
    cout << ans << endl;
    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3540
final_rank: 1

code_snippet: #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;

ll ans=0;
int n,k;

int main(){
  cin>>n>>k;
  int dp[100050][20];
  rep(i,n+1){
    rep(j,k+1){
      dp[i][j]=0;
    }
  }
  rep(i,n+1){
    dp[i][1]=1;
  }
  repi(i,2,k+1){
    repi(j,i-1,n+1){
      for(int k=2;k<=n;k++){
	if(j*k>n) break;

	else dp[j*k][i]+=dp[j][i-1];
      }
    }
  }
 
  ll ans=0;
  repi(i,1,n+1){
    ans+=dp[i][k];
  }
  cout<<ans<<endl;
  return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 10864
final_rank: 6

code_snippet: #include<bits/stdc++.h>
using namespace std;
#define int long long

const int NMAX=100000;
const int KMAX=200;
int dp[NMAX+1][KMAX+1];

signed main()
{
   int N,K; cin>>N>>K;

   if(K>KMAX){
      cout<<0<<endl;
      return 0;
   }

   for(int i=1;i<=N;i++){
      dp[i][1]=1;
      for(int k=1;k<=KMAX;k++){
         for(int j=i*2;j<=N;j+=i){
            dp[j][k+1]+=dp[i][k];
         }
      }
   }

   int ans=0;
   for(int i=1;i<=N;i++){
      ans+=dp[i][K];
   }
   cout<<ans<<endl;
}
accuracy: 1
time_ms: 1130
memory_kb: 159268
final_rank: 18

code_snippet: #include <bits/stdc++.h>
using namespace std;

#define int long long

int dp[100001][17];
int N, K;

int dfs(int n, int k) {
  if ( dp[n][k] >= 0 ) return dp[n][k];  
  if ( k == K ) return 1;

  int ret = 0;
  for ( int i = 2; i <= 100000; i++ ) {
    if ( n*i > N ) break;
    ret += dfs(n*i, k+1);    
  }

  return dp[n][k] = ret;  
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  cin >> N >> K;
  fill_n(*dp, 100001*17, -1);

  int ans = 0;
  for ( int i = 1; i <= N; i++ ) ans += dfs(i, 1);
  cout << ans << endl;  
  
  return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 16500
final_rank: 7

code_snippet: #include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

long long int DP[110000];

int main(){
    int N, K;
    cin >> N >> K;
    for(int i = 1; i <= N; i++){
      DP[i] = 1;
    }
    for(int loop = 0; loop < K - 1; loop++){
      for(int i = N; i >= 1; i--){
        for(int j = i * 2; j <= N; j += i){
          DP[j] += DP[i];
        }
        DP[i] = 0;
      }
    }
    long long int ans = 0;
    for(int i = 1; i <= N; i++){
      ans += DP[i];
    }
    cout << ans << endl;
    return 0;
}
accuracy: 1
time_ms: 30
memory_kb: 3816
final_rank: 2

code_snippet: #include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

long long int DP[100000];

int main(){
    int N, K;
    cin >> N >> K;
    for(int i = 1; i <= N; i++){
      DP[i] = 1;
    }
    for(int loop = 0; loop < K - 1; loop++){
      for(int i = N; i >= 1; i--){
        for(int j = i * 2; j <= N; j += i){
          DP[j] += DP[i];
        }
        DP[i] = 0;
      }
    }
    long long int ans = 0;
    for(int i = 1; i <= N; i++){
      ans += DP[i];
    }
    cout << ans << endl;
    return 0;
}
accuracy: 1
time_ms: 30
memory_kb: 3860
final_rank: 3

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

#pragma warning(disable:4996)
using namespace std;

const int X=100000;
vector<long long int> divisor(long long int n) {
	vector<long long int> res;
	for (long long int i = 1; i * i <= n; ++i) {
		if (n % i == 0) {
			res.push_back(i);
			if (i * i != n) res.push_back(n / i);
		}
	}
	sort(begin(res), end(res));
	return res;
}
int main() {
	vector<vector<long long int>>dp(X+1,vector<long long int>(25));
	for (int num = 1; num <= X; ++num) {
		for (int k = 0; k < 24; ++k) {
			if (k == 0) {
				dp[num][0]=1;
			}
			for (int next = num * 2; next <= X; next += num) {
				dp[next][k+1]+=dp[num][k];
			}
		}
	}
	int N;cin>>N;int K;cin>>K;K--;
	if (K >= 20) {
		cout<<0<<endl;
	}
	else {

		long long int answer = 0;
		for (int i = 1; i <= N; ++i) {
			answer += dp[i][K];
		}
		cout << answer << endl;
	}
	return 0;
}
accuracy: 1
time_ms: 370
memory_kb: 25432
final_rank: 15

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

using pi = pair<int,int>;
int n,k;

ll dfs(int x, int r){
    if(r==0) return 1;

    ll ret = 0;
    for(int i=2; x*i<=n; ++i) ret += dfs(x*i, r-1);
    return ret;
}

int main(){
    cin >>n >>k;
    ll ans = 0;
    for(int i=1; i<=n; ++i) ans += dfs(i,k-1);
    cout << ans << endl;
    return 0;
}
accuracy: 1
time_ms: 700
memory_kb: 3104
final_rank: 16

code_snippet: #include<iostream>
using namespace std;
#define rep(i,s,n) for(int i=s;i<n;i++)
typedef long long ll;
#define N 100010
#define K 20
ll d[N][K];
int main(){
    rep(i,0,N)rep(j,0,K)d[i][j]=(j==1);
    rep(i,1,N)rep(j,1,K-1)for(ll r=i*2;r<N;r+=i){
	d[r][j+1]+=d[i][j];
    }
    ll n,k;cin>>n>>k;
    if(k>=K){
	cout<<0<<endl;
	return 0;
    }
    ll ans=0;
    rep(i,1,n+1)ans+=d[i][k];
    cout<<ans<<endl;
    return 0;
}
accuracy: 1
time_ms: 70
memory_kb: 18748
final_rank: 11

code_snippet: #include <bits/stdc++.h>

using namespace std;
using i64 = int_fast64_t;
using db = long double;
using pii = pair<int, int>;
using pli = pair<int_fast64_t, int>;
using pdi = pair<double, int>;
template <class T> using mat = vector<vector<T>>;
template <class T> using minheap = priority_queue<T, vector<T>, greater<T>>;

#define each(i,v) for (auto i = begin(v); i != end(v); ++i)
#define reach(i,v) for (auto i = rbegin(v); i != rend(v); ++i)
#define urep(i,s,t) for (int i = (s); i <= (t); ++i)
#define drep(i,s,t) for (int i = (s); i >= (t); --i)
#define rep(i,n) urep(i, 0, (n)-1)
#define rep1(i,n) urep(i, 1, (n))
#define rrep(i,n) drep(i, (n)-1, 0)
#define all(v) begin(v), end(v)
#define rall(v) rbegin(v), rend(v)
#define fir first
#define sec second
#define front fro
#define back bac
#define vct vector
#define u_map unordered_map
#define u_set unordered_set
#define l_bnd lower_bound
#define u_bnd upper_bound
#define rsz resize
#define ers erase
#define emp emplace
#define emf emplace_front
#define emb emplace_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define popcnt __builtin_popcount

struct setupper {
    setupper(uint_fast8_t prec) {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        cout << fixed << setprecision(prec);
#ifdef Local
        auto print_atexit = []() { cerr << "Exec time : " << clock() / (double)CLOCKS_PER_SEC * 1000.0 << "ms\n"; };
        atexit(print_atexit);
#endif
    }
} setuppre_obj(10);

namespace std {
    template <class T> void hash_combine(size_t &seed, T const &key) {
        seed ^= hash<T>()(key) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
    }
    template <class T, class U> struct hash<pair<T,U>> {
        size_t operator()(pair<T,U> const &pr) const
        {
            size_t seed = 0;
            hash_combine(seed,pr.first);
            hash_combine(seed,pr.second);
            return seed;
        }
    };
    template <class Tup, size_t index = tuple_size<Tup>::value - 1> struct hashval_calc {
        static void apply(size_t& seed, Tup const& tup) {
            hashval_calc<Tup, index - 1>::apply(seed, tup);
            hash_combine(seed,get<index>(tup));
        }
    };
    template <class Tup> struct hashval_calc<Tup,0> {
        static void apply(size_t& seed, Tup const& tup) {
            hash_combine(seed,get<0>(tup));
        }
    };
    template <class ...T> struct hash<tuple<T...>> {
        size_t operator()(tuple<T...> const& tup) const
        {
            size_t seed = 0;
            hashval_calc<tuple<T...>>::apply(seed,tup);
            return seed;
        }
    };
}

template <class T, class U> ostream& operator << (ostream& s, pair<T,U> p) { return s << p.fir << " " << p.sec; }
template <class T> ostream& operator << (ostream& s, vct<T> v) { each(i,v) { if(i != begin(v)) s << " "; s << *i; } return s; }
#define dump(...) cerr << " [ " << __LINE__ << " : " << __FUNCTION__ << " ] " << #__VA_ARGS__ << " : ";\
dump_func(__VA_ARGS__)
template <class T> void dump_func(T x) { cerr << x << '\n'; }
template <class T,class ...Rest> void dump_func(T x, Rest ... rest) { cerr << x << ","; dump_func(rest...); }
void read() {}
template <class T, class ...Rest> void read(T &x, Rest &... rest) { cin >> x; read(rest...); }
template <class T> void write(T x) { cout << x << '\n'; }
template <class T, class ...Rest> void write(T x, Rest ... rest) { cout << x << ' '; write(rest...); }
void writeln() {}
template <class T, class ...Rest> void writeln(T x, Rest ... rest) { cout << x << '\n'; writeln(rest...); }
#define esc(...) writeln(__VA_ARGS__), exit(0)
const auto add = [](auto &x, auto y) { x += y; };
const auto mul = [](auto &x, auto y) { x *= y; };
const auto lam_min = [](auto x, auto y) { return min(x, y); };
const auto lam_max = [](auto x, auto y) { return max(x, y); };
const auto chmax = [](auto &m, auto x) { if(m < x){ m = x; return true; } return false; };
const auto chmin = [](auto &m, auto x) { if(m > x){ m = x; return true; } return false; };
bool bit(i64 n, uint8_t e) { return (n >> e) & 1; }
i64 mask(i64 n, uint8_t e) { return n & ((1 << e) - 1); }
int ilog(uint64_t x, uint64_t b = 2) { return x ? 1 + ilog(x / b,b) : -1; }
template <class F> i64 binsr(i64 ok, i64 ng, const F &fn) {
    while (abs(ok - ng) > 1) {
        i64 mid = (ok + ng) / 2;
        (fn(mid) ? ok : ng) = mid;
    }
    return ok;
}
template <class A, size_t N, class T> void init(A (&array)[N], const T &val) { fill((T*)array,(T*)(array + N),val); }
template <class T> T cmprs(T &v) {
    T tmp = v, ret = v;
    sort(all(tmp));
    tmp.erase(unique(all(tmp)), end(tmp));
    each(i,ret) *i = l_bnd(all(tmp),*i) - begin(tmp);
    return ret;
}

template <class T> constexpr T inf = numeric_limits<T>::max() / 2 - 1;
constexpr int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
constexpr int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
constexpr long double gold = 1.618033988;
constexpr long double eps = 1e-15;
constexpr uint_fast64_t mod = 1e9 + 7;

int dp[1<<17][20];
int n,k;

i64 solve(int v,int cn) {
    if(cn==1) return 1;
    if(~dp[v][cn]) return dp[v][cn];
    dp[v][cn]=0;
    for(int u=v*2;u<=n;u+=v) dp[v][cn]+=solve(u,cn-1);
    return dp[v][cn];
}

int main() {
    read(n,k);
    init(dp,-1);
    i64 ans=0;
    rep1(i,n) {
        ans+=solve(i,k);
    }
    esc(ans);
}
accuracy: 1
time_ms: 10
memory_kb: 13436
final_rank: 4

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

using namespace std;
using ll=long long;
using ull=unsigned long long;

typedef pair<int,int>Pi;
typedef pair<long long,long long>P;
typedef pair<long long,P>PP;
typedef pair<P,P>PPP;

const long long MOD=1e9+7;
const long long INF=5e18;
const int di[4]={1,0,-1,0};
const int dj[4]={0,1,0,-1};

#define fr first
#define sc second
#define pb push_back
#define eb emplace_back
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()

int n,k,ans;
vector<int>v[100010];

void dfs(int now,int cnt){
	if(cnt==k){
		ans++;
		return;
	}
	for(int u:v[now]){
		dfs(u,cnt+1);
	}
	return;
}

void input(){
	cin>>n>>k;
	return;
}

void solve(){
	for(int i=2;i<=n;i++){
		v[i].eb(1);
	}
	for(int i=2;i<=n;i++){
		for(int j=2;j<=sqrt(i);j++){
			if(i%j==0){
				v[i].eb(j);
				if(i/j!=j)v[i].eb(i/j);
			}
		}
	}
	for(int i=1;i<=n;i++){
		dfs(i,1);
	}
	cout<<ans<<endl;
	return;
}

int main(){
	input();
	solve();
	return 0;
}
accuracy: 1
time_ms: 760
memory_kb: 13144
final_rank: 17

code_snippet: # include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7; //924844033 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<double, double> Dll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourth; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, p, q, last, first, cnt, sum, ans, dp[30][200000], a[200000], b[200000];
string str, ss;
bool f;
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } };
struct Edge { LL to, cost; };
struct edge { LL from, to, cost; };
vector<vector<Edge>>vec;
vector<edge>ed;
vector<LL>v;
map<LL,LL>ma;
set<LL>st;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

int main() {
	cin >> n >> m;
	if (m > 20) {
		cout << 0 << endl;
		return 0;
	}
	rep(i, n+1)dp[0][i] = 1;
	rep(i, m) {
		for (LL j = 1; j <= n; j++) {
			for (LL k = 2; k <= n; k++) {
				if (j*k > n)break;
				dp[i + 1][j*k] += dp[i][j];
			}
		}
	}
	rep(i, n)ans += dp[m-1][i+1];
	cout << ans << endl;
	return 0;
}
accuracy: 1
time_ms: 30
memory_kb: 18672
final_rank: 8