Last Updated: 22 Nov, 2020

Catalan Number

Easy
Asked in companies
GoogleAmazon

Problem statement

You are given an integer n. Your task is to find the nth catalan number. nth Catalan number is defined using following expression:

Alt Text

Input Format:
The first line of input will contain T(number of test cases), each test case follows as.
Next T lines contain an integer n.
Constraints:
1 <= T <= 10^4
0 <= n < 10^3
Output Format:
For each test case. print the answer in a new line.
Since answer can be pretty huge print its modulo with 10^9 + 7