import List

partitionNum n m = iterate f ([[]]: repeat []) !! m !! n  where
  f xs = tail $ snd $ mapAccumL g (repeat []) [0..] where
    g (y:ys) i = (zipWith (++) (map (map (i:)) xs) ys, y)
