Little Deepu vs. Little Kuldeep

0

0 votes
Algorithms, Medium, Open, Approved, Mathematics
Problem

Little Deepu and Little Kuldeep are the two best warriors in the realm of Westeros. But, their priorities and their loyalties are very much divided. Little Kuldeep fights for the right, just while Little Deepu fights for the wrong reasons, and supports the wrong ones in the kingdom. Everyone's scared of these two warriors getting into a fight ever. But, in the final match of the tournament for the best warrior in the kingdom, these two warriors will eventually have to face each other.

But, here's the twist. Since, everyone knows that these two are the best ones, no one wants them to die. So, it's a no-kill contest between them. They CANNOT kill each other. They just have to hit each other, with their best moves.

Both, Little Deepu and Little Kuldeep will get n chances to hit the opponent. But, since Little Deepu fights for the wrong people, he had the power to convince people that he'll be the attacker, and Kuldeep be the defender - that is to say. So, what will happen is the following: Little Kuldeep CANNOT attack Little Deepu before Little Deepu attacks him. Little Kuldeep can only retaliate to Little Deepu's hits, and NOT hit him before Deepu hits him.

That is to say, let's say both of them have 3 moves. So, a valid hitting combination would be:
1. DDDKKK
2. DKDDKK
And 3 other combinations.

So, ONLY after Deepu hits Kuldeep can hit him back!

So, you being a volunteer in managing the fights, have to figure out the number of valid combinations of the n hits by the both of them.

Input format:
The first line contains the number of test cases.
Every test case contains an integer N.

Output format:
You've to print out the number of valid combinations modulo by 1000000007.

Constraints:
1 <= Test Cases < 1001
1 <= N <= 1000000

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?