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 Rust (1.15.1) (judge verdict: Wrong Answer)

pub struct Poper<'a> {
	iter: std::str::SplitWhitespace<'a>,
}

impl<'a> Poper<'a> {
	pub fn new(iter: std::str::SplitWhitespace) -> Poper {
		Poper { iter: iter }
	}
	pub fn read<T: std::str::FromStr>(&mut self) -> T
	where
		<T as std::str::FromStr>::Err: std::fmt::Debug,
	{
		self.iter.next().unwrap().parse().unwrap()
	}
}

const MOD: u64 = 1_000_000_007;

fn main() {
	let input = {
		use std::io::Read;
		let mut s = String::new();
		std::io::stdin().read_to_string(&mut s).unwrap();
		s
	};
	let mut iter = Poper::new(input.split_whitespace());

	let n: u64 = iter.read();
	let k: u64 = iter.read();

	if 1 == k % 2 {
		println!("0");
		return;
	}
	let k = k / 2;

	fn calc(n: u64, f: u64, k: u64) -> u64 {
		let mut r = 0;

		if 0 < n {
			if 0 < f {
				// 今回なにもしない
				r += calc(n - 1, f - 1, k);
				r %= MOD;
			}
			// 同じとことむすぶ
			r += calc(n - 1, f, k);
			r %= MOD;
			if 0 == k {
				return r;
			}
			// 違うとこと１か所結ぶ
			for t in 0..k {
				r += calc(n - 1, f, t);
				r %= MOD;
			}
			// 違うとこと２か所結ぶ
			if 0 < f {
				for t in 0..k {
					r += calc(n - 1, f - 1, t);
					r %= MOD;
				}
			}
			r
		} else {
			1
		}

	}

	println!("{}", calc(n, 0, k));

}