#include <cstdio>
#include<iostream>

using namespace std;

int n,s;
int use[10]={0};
int dp[11][0*1+1*2+3*2+4*3+5*4+6*5+7*6+8*7+9*8+10*9+100]={0};
inline void combination(register int d,register int sum){
	register int t=0;
	dp[d][sum]++;
	if(d==10) return;
	for(int i=0;i<10;i++){
		if(use[i]==0){
			use[i]=1;
			combination(d+1,sum+(i*d));
			use[i]=0;
		}
	}
	return;
}

int main(){
	std::ios_base::sync_with_stdio(false);
	combination(1,0);
	while(cin>>n>>s){
		if(0*1+1*2+3*2+4*3+5*4+6*5+7*6+8*7+9*8+10*9+100>s) cout<<dp[n+1][s]<<endl;
		else cout<<"0"<<endl;
	}

	return 0;
}