#include <iostream>
#include <algorithm>
using namespace std;

int number[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
long long int dp[10][10001];

long long int factorial(int x)
{
	long long int ret = 1;
	for (int i = 1; i <= x; i++) ret *= i;
	return ret;
}

int main()
{
	do
	{
		int sum = 0;
		for (int i = 0; i < 10; i++)
		{
			sum += number[i] * (i + 1);
			dp[i][sum]++;
		}
	} while (next_permutation(number, number + 10));

	int n, s;
	while (cin >> n >> s)
	{
		cout << dp[n - 1][s] / factorial(10 - n) << endl;
	}
	return 0;
}