#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int main() {
  const int N = 10;
  
  int dp[1<<N][331] = {};
  int res = 0;
  REP(i,N) {
    dp[1<<i][i] = 1;
  }
  REP(S,1<<N) {
    vector<int> se;
    REP(j,N)
      if ((S>>j) & 1) {
        se.push_back(j);
        // cout << j << " ";
      }
    FOR(it, se) {
      REP(i,331) {
        if (i + (*it)*se.size() >= 331) break;
        dp[S][i + (*it)*se.size()] += dp[S - (1<<*it)][i];
      }
    }
    // REP(i,331) {
    //   if (dp[S][i])cout << i << " ";
    // }cout << endl;
  }
  int table[11][331] = {};
  for (int i=1; i<=N; ++i) {
    int comb = (1<<i) - 1;
    while (comb < 1 << 10) {
      REP(j,331) {
        table[i][j] += dp[comb][j];
      }
      
      int x = comb & -comb, y = comb + x;
      comb = ((comb & ~y) / x >> 1) | y;
    }
    // if (i == 3) {
    //   REP(j,331) {
    //     cout << table[i][j] << endl;
    //   }
    // }
    // cout << table[i][10] << endl;
  }

  int n, s;
  while(cin >> n >> s) {
    if (n < 0 || n > 10 || s <0 || s >= 331) cout << 0 << endl;
    else    cout << table[n][s] << endl;
  }
}