Given a number n, find count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains the integer n.

**Output:**

Print the count of all binary sequences of length 2n such that sum of first n bits is same as sum of last n bits. Since the answer can be quite large print the answer modulo 10^{9}+7. Print the answer in a new line for each test case in a new line.

**Constraints:**

1<= T <=100

1<= N <=1000

**Example:**

**Input:** n = 1

**Output:** 2

There are 2 sequences of length 2*n, the

sequences are 00 and 11

**Input:**

n = 2

**Output:**

6

There are 6 sequences of length 2*n, the

sequences are 0101, 0110, 1010, 1001, 0000

and 1111

Author: sujnesh

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.

agness | 122 |

aman1931998 | 102 |

Survivor | 100 |

uchitnitk | 96 |

lonecoder | 95 |

KshatriyaYash | 1066 |

nikhil_sojan | 1032 |

lonecoder | 1030 |

mazumderrohit8 | 899 |

SumitSingh27 | 832 |

blackshadows | 5327 |

Ibrahim Nash | 5215 |

akhayrutdinov | 5111 |

mb1973 | 4492 |

Quandray | 4444 |

Login to report an issue on this page.