#P7360. Modular Product of LCMs of K-Tuples
Modular Product of LCMs of K-Tuples
Modular Product of LCMs of K-Tuples
Given two integers N and K (with K > 1), consider all K-tuples (i1, i2, …, iK) where each element is a positive integer not exceeding N. For each K-tuple, calculate the least common multiple (LCM) of its elements. The task is to compute the product of these LCM values modulo 998244353.
The mathematical formulation is:
$$ \prod_{i_1=1}^{N}\prod_{i_2=1}^{N}\cdots\prod_{i_K=1}^{N}\mathrm{lcm}(i_1,i_2,\dots,i_K) \mod 998244353 $$It is guaranteed that K > 1.
inputFormat
The input consists of a single line containing two integers N and K.
outputFormat
Output a single integer, the product of the LCMs for all K-tuples modulo 998244353.
sample
2 2
8