#include<iostream>
#include<vector>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<climits>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int INF = INT_MAX / 2;
const int NUM = 10;
const int N = 11;
const int S = 331;
const int P = (1 << NUM);

int n, s;
int dp[N][S][P];

void make_dp(){
    REP(i, N) REP(j, S) REP(k, P) dp[i][j][k] = 0;
    for(int mask = 1, num = 0; mask < (1 << NUM); mask = (mask << 1), ++num) dp[1][num][mask] = 1;

    FOR(i, 2, N){
        for(int mask = 1, num = 0; mask < (1 << NUM); mask = (mask << 1), ++num){
            FOR(j, num * i, S){
                for(int k = 1; k < (1 << NUM); ++k){
                    if((k & mask) != 0) continue;
                    int p = (k | mask);
                    if(j - (num * i) >= 0) dp[i][j][p] += dp[i - 1][j - (num * i)][k];
                }
            }
        }
    }
}

int main(){
    make_dp();
    while(cin >>n >>s){
        int ans = 0;
        REP(i, P) ans += dp[n][s][i];
        cout <<ans <<endl;
    }
    return 0;
}