$known = {}
def minval(n, rest)
  arr = rest[0..n].reverse
  sum = 0
  n.times{|i|
    sum += (i+1)*arr[i]
  }
  return sum
end
def maxval(n, rest)
  arr = rest[-n, n]
  sum = 0
  n.times{|i|
    sum += (i+1)*arr[i]
  }
  return sum
end

def count(s, n, rest)
  return 1 if s == 0 && n == 0
  return 0 if n == 0
  return 0 if s < minval(n, rest)
  return 0 if s > maxval(n, rest)
  unless $known[[s,n,rest]]
    ans = 0
    rest.each{|i|
      ans += count(s - n * i, n - 1, rest - [i]) if s - n * i >= 0
    }
    $known[[s,n,rest]] = ans
  end
  return $known[[s,n,rest]]
end

init = [0,1,2,3,4,5,6,7,8,9]
readlines.each{|line|
  n, s = line.split.map(&:to_i)
  p count(s, n, init)
}