#P7092. 计数题

计数题

Description

You have an infinite set that contains all primes less than or equal to nn, and also all products made from these primes.

For example, when n=5n=5, the set actually contains 2,3,52,3,5 (primes), and 4,6,8,9,10,124,6,8,9,10,12\ldots (products of primes). Let this set be TT.

Compute:

$\sum\limits_{S\subset T,S\neq\varnothing}\mu(\prod\limits_{i\in S}i)\varphi(\prod\limits_{i\in S}i)$

Take the result modulo 998244353998244353. It can be proven that this sum exists.

To help you get partial scores, we will give an integer kk that represents some restrictions. The value of kk may affect the answer. Please read the hint carefully.

n106n\leq 10^6.

Input Format

One line with two integers n,kn,k.

Output Format

One line with one integer, the answer modulo 998244353998244353.

2 2
998244352
114514 2
662314206

Hint

The restrictions for kk are as follows:

k=0:k=0: The chosen set SS must contain at least one perfect square.

k=1:k=1: The chosen set SS can only contain primes.

k=2:k=2: No restrictions.

Test Point ID nn kk
121\sim 2 5\leq 5 22
353\sim 5 20\leq 20
6116\sim 11 5000\leq 5000
1212 106\leq 10^6 00
131413\sim 14 11
151615\sim 16 105\leq 10^5 22
172017\sim 20 106\leq 10^6

Explanation for Sample 11:

The answer is μ(2)φ(2)=1×1=1\mu(2)\varphi(2)=-1\times 1=-1, which is 998244352998244352 modulo 998244353998244353.

Translated by ChatGPT 5