#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
using namespace std;
int dp[1<<11][11][333];
int solve(int bit,int i,int sum){
  if(i>=11) return 0;
  if(sum>330) return 0;
  if(!i) return (sum)?0:1;
  if(dp[bit][i][sum] >= 0) return dp[bit][i][sum];
  int ret = 0;
  for(int j = 0; j < 10; j++){
    if(bit & 1<<j) continue;
    ret += solve(bit | 1<<j,i-1,sum-j*i);
  }
  return dp[bit][i][sum] = ret;
}
int main(void){
  int n,s;
  memset(dp,-1,sizeof(dp));
  while(cin >> n >> s){
    cout << solve(0,n,s) << endl;
  }
}