#P6162. [Cnoi2020] 四角链

[Cnoi2020] 四角链

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