#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

template <unsigned T>
bool nextBitset(bitset<T> &bs, int digit)
{
    if(bs.none())
        return false;
    bitset<T> x, y, z;
    x = bs.to_ulong() & (~(bs.to_ulong()) + 1ULL);
    y = bs.to_ulong() + x.to_ulong() + 0ULL;
    z = bs & ~y;
    if(bs[digit-1] && bs == z)
        return false;
    bs = ((z.to_ulong() / x.to_ulong()) >> 1) + 0ULL;
    bs |= y;
    return true;
}

int main()
{
    vector<vector<int> > dp(1<<10, vector<int>(331, 0));
    dp[0][0] = 1;
    for(int i=0; i<(1<<10); ++i){
        bitset<10> bs(i);
        for(int j=0; j<10; ++j){
            if(bs[j])
                continue;
            bitset<10> bs1 = bs;
            bs1[j] = true;
            int a = j * bs1.count();
            for(int k=0; k+a<331; ++k)
                dp[bs1.to_ulong()][k+a] += dp[bs.to_ulong()][k];
        }
    }

    for(;;){
        int n, s;
        if(!(cin >> n >> s))
            return 0;

        int ret = 0;
        bitset<10> bs((1<<n)-1);
        do{
            ret += dp[bs.to_ulong()][s];
        }while(nextBitset(bs, 10));
        cout << ret << endl;
    }
}