题目链接
#include<bits/stdc++.h> using namespace std; #define ll long long #define mod 998244353 #define maxn 500100 ll fac[maxn] = {0}, inv[maxn] = {0}; ll q_pow(ll a, ll b){ ll ans = 1; while(b){ if(b&1) ans = ans*a%mod; a = a*a%mod; b >>= 1; } return ans; } ll C(int n, int m){ return fac[n]*inv[m]%mod*inv[n-m]%mod; } void init() { fac[0] = 1; for(int i = 1; i < maxn; i++) fac[i] = fac[i-1] * i % mod; inv[maxn-1] = q_pow(fac[maxn-1], mod-2); for(int i = maxn-2; i >= 0; i--) inv[i] = inv[i+1]*(i+1)%mod; } int main() { init(); int n, k; cin >> n >> k; ll ans = 0; for(int i = 1; i <= n; i++){ if(n/i < k) break; ans = (ans + C(n/i-1, k-1) % mod) % mod; } printf("%lld ", ans); }