#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 dp[11][400][1<<10]={};

signed main(){
	int n,s;
	while(cin>>n>>s){
		if(s>400||n>10){
			o(0); continue;
		}
		rep(i,0,11) rep(j,0,400) rep(k,0,1<<10) dp[i][j][k]=0;
		dp[0][0][0]=1;
		rep(i,1,n+1){
			rep(j,0,400){
				rep(k,0,1<<10){
					rep(l,0,10){
						if(j+l*i>=400||dp[i-1][j][k]==0||(k&1<<l)) continue;
						dp[i][j+l*i][k|1<<l]+=dp[i-1][j][k];
					}
				}
			}
		}
		int ans=0;
		rep(i,0,1<<10){
			ans+=dp[n][s][i];
		}
		o(ans);
	}
}