101345: [AtCoder]ABC134 F - Permutation Oddness

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

Description

Score : $600$ points

Problem Statement

Let us define the oddness of a permutation $p$ = {$p_1,\ p_2,\ ...,\ p_n$} of {$1,\ 2,\ ...,\ n$} as $\sum_{i = 1}^n |i - p_i|$.

Find the number of permutations of {$1,\ 2,\ ...,\ n$} of oddness $k$, modulo $10^9+7$.

Constraints

  • All values in input are integers.
  • $1 \leq n \leq 50$
  • $0 \leq k \leq n^2$

Input

Input is given from Standard Input in the following format:

$n$ $k$

Output

Print the number of permutations of {$1,\ 2,\ ...,\ n$} of oddness $k$, modulo $10^9+7$.


Sample Input 1

3 2

Sample Output 1

2

There are six permutations of {$1,\ 2,\ 3$}. Among them, two have oddness of $2$: {$2,\ 1,\ 3$} and {$1,\ 3,\ 2$}.


Sample Input 2

39 14

Sample Output 2

74764168

Input

题意翻译

定义一个 $1 \sim n$ 的排列 $p$ 的「怪异度」为 $$\sum_{i=1}^n|p_i-i|$$ 求「怪异度」为 $k$ 的 $1 \sim n$ 的排列数,答案对 $10^9+7$ 取模。

加入题单

上一题 下一题 算法标签: