#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int dp[11][331];
void rec(int bit,int d,int s)
{
	dp[d][s]++;
	for(int i=0;i<10;i++)
	{
		if(bit&(1<<i))rec(bit&~(1<<i),d+1,s+i*(d+1));
	}
}
int main()
{
	int n,s;
	rec((1<<10)-1,0,0);
	while(cin >> n >> s)
	{
		if(s>330)cout << 0 << endl;
		else cout << dp[n][s] << endl;
	}
	return 0;
}