#include <cstdio>
using namespace std;

int ans[11][286];

void dfs(int dpt, int sum, int bit){
	++ans[dpt][sum];
	for(int i = 0; i < 10; ++i){
		if(bit >> i & 1){
			dfs(dpt + 1, sum + i * (dpt +1), bit ^ (1 << i));
		}
	}
}

int main(){
	dfs(0, 0, 0x3ff);
	int n, s;
	while(scanf("%d%d", &n, &s) != EOF){
		int x = 0;
		if(n <= 10 && s <= 285){ x = ans[n][s]; }
		printf("%d\n", x);
	}
}