#P7360. 「JZOI-1」红包

    ID: 6318 远端评测题 2500ms 128MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>素数判断,质数,筛法最大公约数,gcd莫比乌斯反演二项式定理容斥

「JZOI-1」红包

Description

The total amount of money in Xiaoxi’s red packet is defined as follows:

Consider all KK-tuples where every element is a positive integer and N\le N. The total amount is the product of the least common multiples of all these KK-tuples.

However, his uncle does not have that much money, so the result should be taken modulo 998244353998244353.

Xiaoxi computed it in 101610^{-16} seconds, but he wants to verify whether it is correct, so he came to you (don’t ask why he doesn’t just open the red packet and check).

In other words, you only need to compute:

$$\prod_{i_1=1}^N\prod_{i_2=1}^N...\prod_{i_K=1}^N{\rm lcm}(i_1,i_2...i_K)\mod 998244353$$

It is guaranteed that K>1K>1. Here, lcm(i1,i2...iK){\rm lcm}(i_1,i_2...i_K) denotes the least common multiple of i1,i2...iKi_1,i_2...i_K.

Input Format

This problem has multiple test cases.

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

The next TT lines each contain two integers N,KN, K, representing one query.

Output Format

Output TT lines, each containing one integer, the answer modulo 998244353998244353.

2
2 2
3 2
8
7776

Hint

For the first test case in the sample, the problem asks for ${\rm lcm}(1,1)\times {\rm lcm}(1,2)\times {\rm lcm}(2,1)\times {\rm lcm}(2,2)$.

Clearly, except for lcm(1,1)=1{\rm lcm}(1,1)=1, all other results are 22, so the answer is 1×2×2×2=81\times2\times2\times2=8.

Data ID NN\le KK\leq T=T=
0 1010 55 1010
1 10610^6 22 10310^3
2 33
3 100100 101810^{18} 100100
4 10510^5 100100 10310^3
5 3×1083\times10^8 11
6 1010010^{100} 1010
7 10610^6 101810^{18} 10310^3
8 1010010^{100}
9

Problem setter: Do you really think there is that much money? Haha, it is all Zimbabwe dollars inside!

Translated by ChatGPT 5