#include <iostream>
#include <vector>

int dp(std::vector<std::vector<std::vector<int>>> &memo, const int &num, const int &sum, const int &usable = 0) {
	if (sum < 0 || sum > 330) {
		return 0;
	}
	else if (num == 0) {
		if (sum == 0) {
			return 1;
		}
		else {
			return 0;
		}
	}
	else if (memo[usable][num][sum] >= 0) {
		return memo[usable][num][sum];
	}
	else {
		int res = 0;
		for (auto i = 0; i < 10; ++i) {
			if ((usable & (1 << i)) == 0) {
				res += dp(memo, num - 1, sum - i * num, usable | (1 << i));
			}
		}
		return memo[usable][num][sum] = res;
	}
}
int main() {
	int n, s;
	std::vector<std::vector<std::vector<int>>> memo(1024, std::vector<std::vector<int>>(10, std::vector<int> (331, -1)));
	while (std::cin >> n >> s) {
		std::cout << dp(memo, n, s) << std::endl;
	}
	return 0;
}