By Deyao Chen
You throw a special programmers' die, which has faces with , , , , , or dots, times. In how many different ways can the sum of all the throws be , for all from to ? Since the answer can be astronomically large, output the remainder of each number divided by .
and
and
No more constraints.
Input consists of a line containing and , separated by a space.
Output a list of numbers, separated by a space which is the different ways in which the sum of all the throws become , respectively.
1 10
1 1 1 1 1 1 0 0 0 0
Since you only throw the dice once, there is only way to make the sum , , …, or and way to make anything larger than .
3 17
1 3 6 10 15 21 25 27 27 25 21 15 10 6 3 1 0
Since you throw it three times, there are ways to get a sum of , ways to get a sum of and ways to get a sum of .