Problem:
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

Solution in Julia (0.5.0) (judge verdict: Accepted)

N,K=map(x->parse(Int,x),split(readline()))
if K%2==1
	println(0)
	exit()
end
K>>=1
const dp=[[[0 for _=1:1350] for _=1:53] for _=1:51]
dp[1][1][1]=1
const mod=10^9+7
for i=1:N,j=1:i+1,k=1:K+1
	if dp[i][j][k]==0
		continue
	end
	dp[i+1][j][k+j-1]=(dp[i+1][j][k+j-1]+dp[i][j][k]*(2j-1))%mod
	dp[i+1][j+1][k+j]=(dp[i+1][j+1][k+j]+dp[i][j][k])%mod
	if j>1
		dp[i+1][j-1][k+j-2]=(dp[i+1][j-1][k+j-2]+dp[i][j][k]*(j-1)*(j-1))%mod
	end
end
println(dp[N+1][1][K+1])