#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#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()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define F first
#define S second

int ans=0,used[10];
void dfs(int n,int s){
  if(s<0)return;
  if(n==0 && s==0){
    ++ans;
    return;
  }
  for(int i=0;i<=9;i++){
    if(used[i])continue;
    used[i]=true;
    dfs(n-1,s-n*i);
    used[i]=false;
  }
}
  
int memo[11][331];

main(){
  rep(i,10)used[i]=i;
  int p=0;
  do{
    ++p;
    int sum=0;
    rep(i,10){
      sum+=used[i]*(i+1);
      memo[i+1][sum]++;
    }
  }while(next_permutation(used,used+10));

  int n,s;
  while(~scanf("%d%d",&n,&s)){
    int t=1,f=10-n;
    while(f)t*=f--;
    int ans;
    if(s>=331)ans=0;
    else ans=memo[n][s]/t;
    printf("%d\n",ans);
  }

}