Mapped String
Easy Accuracy: 41.46% Submissions: 275 Points: 2

Given 'N' unique characters (in infinite supply), find the number of possible mapped strings (P) of length 'N'. A Mapped string is one that follows following properties:

a. Both the left and right halves of the string contains unique characters.

b. Both the left and right halves of the string contains same characters.

For example: “abccba” is Mapped string since the left half(“abc”) do contain the same characters as the right half( “cba” ).

Input
The first line contains an integer 'T' denoting the number of testcases. Then 'T' test cases follows. Each test case consists of a single line containing a single integer 'N' denoting the number of unique characters.


Output
For each testcase print P modulo 1000000007. (Since the answer could be large so print it modulo 1000000007).


Constraints
1 <= T <= 200
2 <=N <= 10^6

Note:
N is always even.


Example:
INPUT
2
2
8

OUTPUT
2
40320

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.