#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;/*
int memo[1000][1<<11];

int n,s;
int dfs(int sum,int B,int depth){
    if(depth == n){
        if(sum == s)return 1;
        return 0;
    }
    if(memo[sum][B])return memo[sum][B];
    int bit_cnt = 0;
    int num = 0;
    for(int i = 0;i < 10;i++){
        if(B&(1<<i))continue;
        num += dfs(sum + (depth+1)*i,B+(1<<i),depth+1);
    }
    memo[sum][B] = num;
    return num;
}
int main(){

    while(cin>>n>>s)cout<<dfs(0,0,0)<<endl;



    return 0;
}*/

int dp[1000][1<<11] = {0};//[i][j] = 数字がiになる　bit列jが使用済み
int main(void){

    int n,s;
    while(cin>>n>>s){
    for(int i = 0;i < 1000;i++)for(int j = 0;j < (1<<11);j++)dp[i][j] = 0;
    dp[0][0] = 1;
    for(int i = 0;i <= s;i++){
        for(int j = 0;j < (1<<10);j++){
            if(dp[i][j]!=0){
                int bit_cnt = 1;
                for(int k = 0;k < 10;k++){
                    if(j&(1<<k))bit_cnt++;
                }
                for(int k = 0;k < 10;k++){
                    if(j&(1<<k))continue;
                    dp[i+bit_cnt*k][j+(1<<k)] += dp[i][j];
                    //if(i+bit_cnt*k<=s&&bit_cnt<=n)cout<<i<<"+"<<bit_cnt<<"*"<<k<<"  "<<dp[i][j]<<endl;
                }
            }
        }
    }

    int ans = 0;
    for(int j = 0;j < (1<<10);j++){
        if(dp[s][j]!=0){
            int cnt = 0;
            for(int i = 9;i >= 0;i--){if(j&(1<<i))cnt++;}
            //cout<<endl;
            //cout<<endl<<"+"<<cnt<<" "<<dp[s][j]<<endl;
            if(cnt==n)ans += dp[s][j];
        }
    }
    cout<<ans<<endl;

    }


    return 0;
}