#P8152. 「PMOI-5」破译

「PMOI-5」破译

Background

In 2077, the time traveler Lanuxhem invented a cipher that converts graphics into numbers in order to contact Silver187 in 2021.

Problem Description

lhm currently has a square with side length 11. Now he will perform kk splits. In each split, he needs to further split the rectangle located at the bottom-right corner of the figure into n×nn \times n rectangles. After all splits are completed, the total number of rectangles is the decrypted answer. lhm needs your help to solve this problem.

Note: Since the description is hard to visualize, please refer to the sample explanation to better understand the task.

Input Format

The input consists of one line.
One line contains two integers n,kn, k, with meanings as described in the statement.

Output Format

The output consists of one line.
Output one integer, representing the final answer.
Since the answer may be very large, output it modulo 998244353998244353.

2 2
7
5 3
73

Hint

Sample Explanation

For Sample #1, perform 22 splits. Each time, split the bottom-right rectangle into 2×22 \times 2 rectangles.

In the first split, since there is only one rectangle, the bottom-right rectangle is exactly this rectangle. Before and after the split are as follows:

becomes

Next, perform the second split and split the bottom-right rectangle. The result is as shown below:

This figure contains 77 rectangles, so the answer is 77.

Constraints

For 10%10\% of the testdata, k=1k = 1.
For another 20%20\% of the testdata, 1n,k101 \leq n, k \leq 10.
For 100%100\% of the testdata, 1n,k1091 \leq n, k \leq 10^9.


2022.7.102022.7.10: A new set of Hack\text{Hack} testdata has been added.

Translated by ChatGPT 5