#P5519. Yuyuko's Destiny Function
Yuyuko's Destiny Function
Yuyuko's Destiny Function
In the fantasy world of Gensokyo, the gluttonous ghost Yuyuko—famed for her connection with death—has discovered a mysterious function hidden in the drifting cherry blossoms. This function, defined as
$$ f(x,y)=\begin{cases} 2 & ,\; x=1,\\ 2^x & ,\; 2\le x\le 42,\; y=0,\\ \prod\limits_{i=1}^{42} f(x-i,0)^i & ,\; x\ge43,\; y=0,\\ f(x-1,y)f(x,y-1) & ,\; x\ge2,\; y\ge1, \end{cases} $$Yuyuko believes that the meaning of this function reflects the destiny of OI competitors, and she challenges you to compute f(n, k) mod 998244353 for given integers n and k.
inputFormat
The input consists of a single line containing two integers n
and k
separated by a space, representing the parameters for the function.
outputFormat
Output a single integer which is the value of f(n, k) modulo 998244353.
sample
1 0
2