#include <stdio.h>
unsigned short dp[11][1024][341],ans[11][341];int main() {unsigned short i,j,k,s;dp[0][0][0]=1;
    for (i=0;i<10;i++) for (j=0;j<1024;j++) for (k=0;k<331;k++) {if (!dp[i][j][k]) continue; for (s=0;s<10;s++) if (!(j&(1<<s))) dp[i+1][j|(1<<s)][i*s+s+k]+=dp[i][j][k];}
    for (i=0;i<11;i++) for (j=0;j<1024;j++) for (k=0;k<331;ans[i][k]+=dp[i][j][k],k++);while (scanf("%hu %hu",&i,&j)!=EOF) {if (i>10 || j>330) {puts("0");continue;} else printf("%hu\n",ans[i][j]);} return 0;}