Print binomial expansion series
Submissions: 832   Accuracy:

40.28%

  Difficulty: Easy   Marks: 2

Given three integers A, X, and n, the task is to print terms of below binomial expression series.
(A+X)n = nC0AnX0 + nC1An-1X1 + nC2An-2X2 +….+ nCnA0Xn

Input:
The first line contains an integer T, the number of test cases. For each test case, there are three integers A, X, and n as shown above.

Output:
For each test case, the output is the terms of the binomial expression series.

Constraints:
1<=T<=100
1<=A<=30
1<=X<=30
1<=n<=9

Example:
Input
3
1 1 5
1 2 6
3 4 5
Output
1 5 10 10 5 1
1 12 60 160 240 192 64
243 1620 4320 5760 3840 1024

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

Contributor: Vanshika
Author: Vanshika_pec


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.