Consider a sequence of n numbers using integers from 0 to 9 k1, k2, ..., kn. Read the positive integers n and s,

k1 + 2 x k2 + 3 x k3 + ... + n x kn = s

Create a program that outputs how many rows of n numbers such as. However, the same number does not appear more than once in one "n sequence of numbers".



Input

The input consists of multiple datasets. For each dataset, n (1 ≤ n ≤ 10) and s (0 ≤ s ≤ 10,000) are given on one line, separated by blanks.

The number of datasets does not exceed 100.

Output

For each dataset, print the number of combinations in which the sum of n integers is s on one line.

Example

Input

3 10
3 1


Output

8
0
#include <iostream>
#include <cstring>

using namespace std;

#define LIMIT 330

int cnt[11][LIMIT+1];
bool used[11];

void make(int k,int N,int sum){
  if(sum > LIMIT) return;

  if(N == 0){
    cnt[k][sum]++;
    return;
  }

  for(int i = 0 ; i <= 9 ; i++){
    if(!used[i]){
      used[i] = true;
      make(k + 1 , N - 1 ,sum + (k+1)*i);
      used[i] = false;
    }
  }
}

void init(){
  for(int i = 0 ; i <= 10 ; i++){
    memset(used,false,sizeof(used));
    make(0,i,0);    
  }
}

int main(){
  int n,s;

  init();

  while(cin >> n >> s){
    if(s <= LIMIT){
      cout << cnt[n][s] << endl;
    }else{
      cout << 0 << endl;
    }
  }

  return 0;
}