main = interact $ unlines . map (show . comb_of_numseq . map read . words) . lines
 
comb_of_numseq [n,s]
 | s > 330 = 0
 | otherwise = search [9,8..0] (map (*) [n-1,n-2..1]) s
 where
  search _ [] 0 = 1
  search _ [] _ = 0
  search [] _ _ = 0
  search (c:cs) (f:fs) s
   | s < 0 = 0
   | f c > s = search cs (f:fs) s
   | otherwise = search cs fs (s - f c) + search cs (f:fs) s