dice identical dice, each with faces numbered 1 to faces. All of them are rolled at once and the numbers that come up are added together.
The dice are distinguishable: a roll is defined by the number on the first die, the number on the second, and so on, so there are faces to the power of dice possible rolls.
Return how many of them add up to exactly total. The answer can be huge, so return it modulo 10⁹ + 7.dice=2, faces=4, total=5 → 4
The rolls 1+4, 2+3, 3+2 and 4+1 work: four of them. The dice are distinguishable, so 1+4 and 4+1 count separately.
dice=3, faces=2, total=7 → 0
Three two-sided dice can show at most 6, so 7 is impossible.
dice=25, faces=20, total=260 → 255576909
dice, faces ≤ 30total ≤ 1000dice=2, faces=4, total=5
4
Run checks the first 3 tests in your browser. Submit checks all 111 tests on the server, hidden ones included.