Dice throw
Submissions: 7293   Accuracy:


  Difficulty: Basic   Marks: 1
Associated Course(s):   Sudo Placement 2019

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.
1 <=T<= 100
1 <=m,n,x<= 50


6 3 12
10 8 25


** For More Input/Output Examples Use 'Expected Output' option **

Author: atharv

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.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.