Language: C++

#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long double ld;
#define mp make_pair
#define pb push_back
const ll mod = 1000000007;

void sayNo() {
	cout << "No" << endl;
}

void sayYes() {
	cout << "Yes" << endl;
}


int main() {
	 int N, K;
	 cin >> N >> K;

	 ll dp[N+1][N+1][K+1];
	 for (int j = 0; j <= N; j++) {
		 for (int k = 0; k <= K; k++) {
			 dp[1][j][k] = 0;
		 }
	 }
	 dp[1][0][0] = 1;
	 dp[1][1][2] = 1;

	 for (int i = 2; i <= N; i++) {
		 for (int j = 0; j <= i; j++) {
			 for (int k = 0; k <= K; k += 2) {
				 dp[i][j][k] = 0;
				 if (k - 2 * j >= 0) {
					 dp[i][j][k] += dp[i - 1][j][k - 2 * j] * (2 * j + 1);
					 dp[i][j][k] %= mod;

					 dp[i][j][k] += dp[i - 1][j + 1][k - 2 * j] * (j + 1) * (j + 1);
					 dp[i][j][k] %= mod;

					 if (j > 0) {
						 dp[i][j][k] += dp[i - 1][j - 1][k - 2 * j];
						 dp[i][j][k] %= mod;
					 }
				 }
				 // cout << "(" << i << ", " << j << ", " << k << ") : " << dp[i][j][k] << endl;
			 }
		 }
	 }

	 cout << dp[N][0][K] << endl;

	 return 0;
}

Compiler output:
a.cc: In function 'void sayNo()':
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << "No" << endl;
      |         ^~~~
a.cc:5:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include<queue>
  +++ |+#include <iostream>
    5 | using namespace std;
a.cc:20:25: error: 'endl' was not declared in this scope
   20 |         cout << "No" << endl;
      |                         ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include<queue>
  +++ |+#include <ostream>
    5 | using namespace std;
a.cc: In function 'void sayYes()':
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:26: error: 'endl' was not declared in this scope
   24 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:24:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc: In function 'int main()':
a.cc:30:10: error: 'cin' was not declared in this scope
   30 |          cin >> N >> K;
      |          ^~~
a.cc:30:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:62:10: error: 'cout' was not declared in this scope
   62 |          cout << dp[N][0][K] << endl;
      |          ^~~~
a.cc:62:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:62:33: error: 'endl' was not declared in this scope
   62 |          cout << dp[N][0][K] << endl;
      |                                 ^~~~
a.cc:62:33: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'