#include <iostream>
#include <algorithm>
using namespace std;


int table[10][10001];
int perm[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };


int calc(int n){
	int sum = 0;
	for (int i = 0; i < n; i++) sum += (i + 1) * perm[i];
	return sum;
}


void solve(){
	do {
		for (int i = 1; i <= 10; i++){
			table[i - 1][calc(i)]++;
		}
	} while (next_permutation(&perm[0], &perm[10]));
}


int factorial(int n){
	if (n == 1) return 1;
	return n * factorial(n - 1);
}


int main(){
	solve();

	int n, s;
	while (cin >> n >> s){
		cout << table[n - 1][s] / factorial(10 - n) << endl;
	}

	return 0;
}