Dyck Path
Submissions: 770   Accuracy:

35.42%

  Difficulty: Medium   Marks: 4

Consider a n x n grid with indexes of top left corner as (0, 0). Dyck path is a staircase walk from bottom left, i.e., (n-1, 0) to top right, i.e., (0, n-1) that lies above the diagonal cells (or cells on line from bottom left to top right).

The task is to count the number of Dyck Paths from (n-1, 0) to (0, n-1).

Input:

The first line of input contains an integer T denoting the number of test cases.
Each test case is in a separate single line containing an Integer n, representing a grid of n x n.

Output:

Print the number of dyck paths corresponding to each test in a separate line.

Constraints:

1 ≤ T ≤ 50
1 ≤ n ≤ 30

Example:

Input
2
4
3

 

Output
14

5

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

Author: vaibhav2992


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.