Pascal Triangle
Submissions: 6014   Accuracy:

29.85%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given a positive integer K, return the Kth row of pascal triangle.
Pascal's triangle is a triangular array of the binomial coefficients formed by summing up the elements of previous row.

Example :
1
1 1
1 2 1
1 3 3 1
For K = 3, return 3rd row i.e 1 2 1

Input:
First line contains an integer T, total number of test cases. Next T lines contains an integer N denoting the row of triangle to be printed.

Output:
Print the Nth row of triangle in a separate line.

Constraints:
1 ≤ T ≤ 50
1 ≤ N ≤ 25

Example:
Input:
1
4
Output:
1 3 3 1

 

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

Author: shef5


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.