#P6060. [加油武汉] 传染病研究

[加油武汉] 传染病研究

Description

After learning that pneumonia broke out in City W, scientists immediately began intensive research.

(The following part is not rigorous science. Do not take it seriously outside of solving this problem.)

Suppose a certain virus has a spreading ability D(x)D(x) on day xx. The meaning of this function is the number of divisors of xx. For example, D(6)=4,D(7)=2D(6)=4, D(7)=2.

Now you are given the total number of spreading days nn and an influence constant kk. You need to compute i=1nD(ik)\sum_{i=1}^n D(i^k), that is, D(1k)+D(2k)+D(3k)++D(nk)D(1^k)+D(2^k)+D(3^k)+ \cdots +D(n^k).

Since the answer may be very large, output it modulo 998244353998244353.

Sample Explanation

D(12)+D(22)+D(32)+D(42)+D(52)D(1^2)+D(2^2)+D(3^2)+D(4^2)+D(5^2)
=D(1)+D(4)+D(9)+D(16)+D(25)=D(1)+D(4)+D(9)+D(16)+D(25)
=(1)+(3)+(3)+(5)+(3)=(1)+(3)+(3)+(5)+(3).

11 has 11 divisor: 11;
44 has 33 divisors: 1,2,41,2,4;
99 has 33 divisors: 1,3,91,3,9;
1616 has 55 divisors: 1,2,4,8,161,2,4,8,16;
2525 has 33 divisors: 1,5,251,5,25.

The total is 1515.

Input Format

This problem contains multiple test cases.

The first line contains an integer TT, indicating the number of test cases.

Each of the next lines contains two integers n,kn,k, with the meaning as described above.

Output Format

Output TT lines in total, where each line is the answer for one test case.

1
5 2
15

Hint

  • For 20%20\% of the testdata, 1T10,1n100,1k61\leq T\leq 10,1\leq n\leq 100,1\leq k\leq 6.
  • There is another 30%30\% of the testdata where 1T104,1n107,k=11 \leq T \leq 10^4,1\leq n \leq 10^7,k=1.
  • For 100%100\% of the testdata, 1T104,1n,k1071 \leq T \leq 10^4,1\leq n,k \leq 10^7.

Translated by ChatGPT 5