var dp=[];
for(var i=0;i<=11;i++){
   dp[i]=[];
   for(var j=0;j<=330;j++){
      dp[i][j]=0;
   }
}
 
function bomb(ary,sum,cnt){
cnt++;
dp[cnt][sum]++;

ary.forEach(function(v,i){
bomb(ary.filter(function(value){return v!=value;}),sum+i*cnt,cnt);
});

}
 
bomb([0,1,2,3,4,5,6,7,8,9],0,0);

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
arr.forEach(function(v){
var ns=v.split(" ").map(Number);
var n=ns[0];
var s=ns[1];
console.log(dp[n+1][s]);
});