// AOJ 0070
#include<iostream>
#include<algorithm>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
typedef long long int integer;

const integer NMAX = 11, SMAX = 1000;
integer dp[NMAX][SMAX], factorial[NMAX]; 

void solve() {
  factorial[0] = 1;
  for (int i = 1; i <= 10; i++) {
    factorial[i] = i * factorial[i - 1];
  }

  int nums[10] = {0,1,2,3,4,5,6,7,8,9};
  do {
    integer sum = 0;
    REP(i, 10) {
      sum += nums[i] * (i + 1); 
      dp[i+1][sum]++;
    }
  } while (next_permutation(nums, nums + 10));
}

int main() {
  solve();
  
  int n, s;
  while (cin >> n >> s) {
    cout << dp[n][s] / factorial[10 - n] << endl;
  }
}