#include<cstdio>
#include<cstring>
#define PMT 1<<10
#define MAX 330
#define N 10

int dp[N+1][PMT][MAX+1];

int bitdp(int n, int pmt, int s){
  int ans=0;
  if(n > N || s < 0|| s > MAX)return 0;
  if(dp[n][pmt][s] >= 0)return dp[n][pmt][s];
  if(n==1){
    if( s<N && !(pmt & ( 1<<s )) )
      ans=1;
  }
  else{
    for(int i=0; i<N; ++i){
      if( !(pmt&( 1<<i )) ){
	ans+=bitdp(n-1,pmt+(1<<i),s - i*n);
      }
    }
  }
  dp[n][pmt][s]=ans;
  return ans;
}

int main(){
  int n,s,cp;
  memset(dp,-1,sizeof(dp));

  while(scanf("%d%d",&n,&s)!=EOF)
    printf("%d\n",bitdp(n,0,s));
  
  return 0;
}