D1,D2,D3,D4,D5 = 4,3,6,3,5
D1,D2,D3,D4,D5 = 4,3,3,5,6
D1,D2,D3,D4,D5 = 3,3,3,6,6
D1,D2,D3,D4,D5 = 6,6,3,3,3
Now we have a extended problem:
In how many ways can n m-sided dice (sides numbered 1 to m) be rolled so that the top k numbers sum to p?
There are multiple test cases. (about 15 groups)
For each test case, there is only four integers n, m, k, p (1 ≤ k ≤ n ≤ 20, 3 ≤ m ≤ 12).
For each test case, output an integer indicating the answer.
No tag edit access