#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int num[10];
int dp[11][331];
int fact[11];

signed main(){
	rep(i,0,10) num[i]=i;
	do{
		int t=0;
		rep(i,0,10){
			t+=num[i]*(i+1);
			dp[i+1][t]++;
		}
	}while(next_permutation(num,num+10));

	fact[0]=1;
	rep(i,1,10) fact[i]=fact[i-1]*i;

	int n,s;
	while(cin>>n>>s){
		if(s>331||n>10){
			o(0); continue;
		}
		o(dp[n][s]/fact[10-n]);
	}
}