Given n dice each with m faces, numbered from 1 to m, find the number of ways to get sum X. X is the summation of values on each face when all the dice are thrown.
Input: The first line of the input contains T denoting the number of test cases. First line of test case is faces 'm', number of throws 'n' and the sum to obtain 'x'.
Output: Number of ways to get sum 'x' are displayed.
Constraints:
1 <= T <= 100
1 <= m,n,x <= 50
Example:
Input:
2
6 3 12
10 8 25
Output:
25
318648
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.
bruceewayne | 119 |
rajupraaa1234 | 110 |
SUZAKU | 104 |
yash_sharan | 104 |
Core_Ka_Bachha | 99 |
mr_kksparrow | 433 |
manvirag982 | 302 |
rajupraaa1234 | 245 |
Exception_404 | 244 |
snow_den_ | 236 |
blackshadows | 5331 |
Ibrahim Nash | 5219 |
akhayrutdinov | 5111 |
mb1973 | 4929 |
Quandray | 4567 |