use proconio::input; fn main() { input! { n:usize, } const MOD: usize = 998244353; let ps = eratosthenes_sieve(n); let mut fs_p = vec![0; ps.len()]; for (i, &p) in ps.iter().enumerate() { let mut x = p; while x <= n { fs_p[i] += n / x; x *= p; } } let mut ans = 0; for i in 1..=fs_p[0] { let mut prod = 1; for &f_p in fs_p.iter() { if f_p < i { break; } prod *= f_p / i + 1; prod %= MOD; } prod = (MOD + prod - 1) % MOD; ans += prod; ans %= MOD; } println!("{}", ans); } use math::eratosthenes_sieve; mod math { #[allow(dead_code)] pub fn pow(mut n: usize, mut e: usize, m: usize) -> usize { let mut res = 1; n %= m; while 0 < e { if e & 1 != 0 { res *= n; res %= m; } n *= n; n %= m; e >>= 1; } res } #[allow(dead_code)] pub fn gcd(a: usize, b: usize) -> usize { if b == 0 { a } else { gcd(b, a % b) } } #[allow(dead_code)] pub fn lcm(a: usize, b: usize) -> usize { a / gcd(a, b) * b } #[allow(dead_code)] pub fn prime_factor(mut n: usize) -> std::collections::HashMap { let mut pfacs = std::collections::HashMap::new(); for d in 2.. { if d * d > n { break; } while n % d == 0 { *pfacs.entry(d).or_insert(0) += 1; n /= d; } } if n != 1 { *pfacs.entry(n).or_insert(0) += 1; } pfacs } #[allow(dead_code)] pub fn divisors(n: usize) -> Vec { let mut divs = vec![]; for d in (1..).take_while(|&d| d * d <= n) { if n % d == 0 { divs.push(d); if n / d != d { divs.push(n / d); } } } divs } #[allow(dead_code)] pub fn eratosthenes_sieve(n: usize) -> Vec { let mut is_primes = vec![true; n + 1]; is_primes[0] = false; is_primes[1] = false; let mut primes = vec![]; for i in 2..=n { if !is_primes[i] { continue; } for j in (2 * i..=n).step_by(i) { is_primes[j] = false; } } for (val, is_prime) in is_primes.into_iter().enumerate() { if is_prime { primes.push(val); } } primes } #[allow(dead_code)] pub fn base_n(mut base10: usize, base: usize, len: usize) -> Vec { let mut base_n = vec![]; for _ in 0..len { base_n.push(base10 % base); base10 /= base; } base_n.reverse(); base_n } #[allow(dead_code)] pub fn div_floor(mut a: i64, mut b: i64) -> i64 { if b < 0 { a = -a; b = -b; } if a >= 0 { a / b } else { (a + 1) / b - 1 } } #[allow(dead_code)] pub fn div_ceil(mut a: i64, mut b: i64) -> i64 { if b < 0 { a = -a; b = -b; } if a > 0 { (a - 1) / b + 1 } else { a / b } } }