#include <iostream>
#include <cstring>
using namespace std;
const int N_MAX = 10;
const int S_MAX = 330;
int results[N_MAX + 1][S_MAX + 1];
bool used[10 + 1];
int i;

void permutations(int p, int sum) {
	if (p == 0) {
		results[i][sum]++;
	}
	else {
		for (int i = 0; i < 10; i++) {
			if (used[i]) continue;
			used[i] = true;
			permutations(p - 1, sum + i * p);
			used[i] = false;
		}
	}
}

int main () {
	for (i = 1; i <= 10; i++) {
		memset(results, 0, sizeof(0));
		permutations(i, 0);
	}
	int n, s;
	while (cin >> n >> s) {
		if (s > S_MAX) cout << 0 << endl;
		else cout << results[n][s] << endl;
	}
	return 0;
}