#P6162. [Cnoi2020] 四角链

[Cnoi2020] 四角链

Background

A quadrilateral chain graph is a common quadrilateral network. It belongs to cactus graphs. It usually does not appear in the cross-section at the tail of a heavily doped single crystal. What appears is a closed non-quadrilateral ring network whose outer boundary is a set of impurity-enriched stripes. However, because of its complex characteristics, it often appears in scenarios describing community connections, such as some well-known indescribable ones...

As a smart and lively girl, Cirno got tired of the textbook-style long and boring concepts, and directly gave the diagram of a quadrilateral chain graph.

Problem Description

In fact, a quadrilateral chain can be abstracted as a 1×(n1)1\times (n - 1) grid. Each cell is numbered 11, 22, \ldots, n1n-1, respectively.

Each cell can take one of two choices:

  • Leave it empty.
  • Fill in a positive integer that is less than or equal to its own index.

If a filling scheme does not have two cells filled with the same number, Cirno calls it a valid scheme.

Cirno wants to know the number of valid schemes in which exactly kk cells are filled with numbers, modulo 998244353998244353.

Input Format

One line containing two integers nn, kk.

Output Format

One line containing one integer, the answer.

10 5
42525
642 357
409821948
666666 233333
791003566

Hint

Constraints

This problem uses bundled testdata.

  • Subtask 1 ( 20%20\% ): n,k10n,k \le 10.
  • Subtask 2 ( 20%20\% ): n,k1000n,k \le 1000.
  • Subtask 3 ( 60%60\% ): no special constraints.

For 100%100\% of the testdata: 0k<n1060 \le k < n \le 10^6.

Notes

  • The following references are not necessary to read.

Reference

Translated by ChatGPT 5