Number of ways to roll some X, with n, m-sided dice. Using dynamic programming