#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>


using namespace std;

const int MaxSum = 330;
const int MaxN = 10;
int table[MaxN+1][MaxSum+1];
int mask = (1 << MaxN) - 1;

void recur(int n, int depth, int sum)
{
	if (depth == n)
	{
		++table[n][sum];
	}
	else
	{
		for (int i = 0; i < MaxN; ++i)
		{
			int f = 1 << i;
			if (mask & f)
			{
				mask ^= f;
				recur(n, depth+1, sum + (depth+1)*i);
				mask ^= f;
			}
		}
	}
}

int main()
{
	for (int i = 1; i <= MaxN; ++i)
		recur(i, 0, 0);

	int n, s;
	while (scanf("%d %d", &n, &s) != EOF)
	{
		if (s <= MaxSum)
			printf("%d\n", table[n][s]);
		else
			puts("0");
	}

	return 0;
}