103096: [Atcoder]ABC309 G - Ban Permutation

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:1 Solved:0

Description

Score : $575$ points

Problem Statement

Find the number, modulo $998244353$, of permutations $P=(P_1,P_2,\dots,P_N)$ of $(1,2,\dots,N)$ such that:

  • $|P_i - i| \ge X$ for all integers $i$ with $1 \le i \le N$.

Constraints

  • $1 \le N \le 100$
  • $1 \le X \le 5$
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

$N$ $X$

Output

Print the answer.


Sample Input 1

3 1

Sample Output 1

2

The conforming permutations $P=(P_1,P_2,P_3)$ are the following two, $(2,3,1)$ and $(3,1,2)$, so the answer is $2$.


Sample Input 2

5 2

Sample Output 2

4

Sample Input 3

98 5

Sample Output 3

809422418

Input

题意翻译

求长为 $N(N\leq 100)$ 且满足以下条件的排列 $P=(P_1,P_2,...,P_N)$ 的个数: - $\forall 1\leq i\leq N$,$|P_i-i|\geq X(X\leq 5)$。 #### 输入格式 一行两个整数 $N$ 和 $X$,用空格隔开。 #### 输出格式 一行一个整数,表示满足条件的排列个数,对 $998244353$ 取模。

Output

分数:575分

问题描述

找到满足以下条件的排列$P=(P_1,P_2,\dots,P_N)$的数量(对模$998244353$取逆元):

  • 对于所有整数$i$,满足$1 \le i \le N$,有$|P_i - i| \ge X$。

限制条件

  • $1 \le N \le 100$
  • $1 \le X \le 5$
  • 所有输入值都是整数。

输入

输入将从标准输入以以下格式给出:

$N$ $X$

输出

输出答案。


样例输入1

3 1

样例输出1

2

符合要求的排列$P=(P_1,P_2,P_3)$是以下两个:$(2,3,1)$和$(3,1,2)$,因此答案是$2$。


样例输入2

5 2

样例输出2

4

样例输入3

98 5

样例输出3

809422418

加入题单

算法标签: