#P12021. Multiplicative Constraint Subset Selection
Multiplicative Constraint Subset Selection
Multiplicative Constraint Subset Selection
Given two integers n and k, consider the set of natural numbers \(\{1, 2, \dots, n\}\). You are to choose a subset (which may be empty) such that if a number \(x\) is selected then its multiple \(kx\) is not selected (provided \(kx \le n\)).
Formally, if \(x\) is chosen then \(kx\) must not be chosen. Compute the total number of such selections (order does not matter) modulo \(998244353\).
Note: If \(kx > n\) the condition is ignored for that particular number.
inputFormat
The input consists of two space-separated integers:
\(n\) \(k\)
where \(1 \le n \le 10^9\) (or as specified) and \(k \ge 1\).
outputFormat
Output a single integer: the number of valid selections modulo \(998244353\).
sample
3 2
6