#include<iostream>
#include<math.h>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<iomanip>
using namespace std;
#define INF 1<<20
int main() {
	int n, s;
	int dp[11][1 << 10][350];
	dp[0][0][0] = 1;
	for (int i = 1;i < 11;i++) {
		for (int j = 0;j < (1 << 10);j++) {
			for (int k = 0;k <= 331;k++) {
				if (dp[i-1][j][k] == 0) continue;
				for (int c = 0;c < 10;c++) {
					if (!(j >> c & 1)) {
						dp[i][j | (1 << c)][i*c + k] += dp[i - 1][j][k];
					}
				}
			}
		}
	}
	int ans[11][350] = { {0} };
	for (int i = 0; i < 11; i++) {
		for (int j = 0; j < (1 << 10); j++) {
			for (int c = 0; c < 331; c++) {
				ans[i][c] += dp[i][j][c];
			}
		}
	}

	while (cin >> n >> s) {
		cout << ans[n][s] << endl;
	}
	}