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