#include <iostream>
#include<cstdlib>
#include <stdio.h>
#include <string.h>
using namespace std;
int table[10+1][331];
bool memo[10];
int n;

void rec(int depth, int sum) {
	table[depth][sum]++;
	for (int i = 0; i <= 9; i++) {
		if (memo[i]) continue;
		memo[i] = true;
		rec(depth + 1, sum + i * (depth+1));
		memo[i] = false;
	}
}

void q70() {
	memset(table, 0, sizeof(table));
	memset(memo, 0, sizeof(memo));
	rec(0, 0);
	int n, s;
	for (; cin >> n >> s;) {
		if (n > 10 || s > 330) {
			cout << "0" << endl;
			continue;
		}
		cout << table[n][s] << endl;
	}
}

int main() {
	q70();
	return 0;
}