Mapped String
Submissions: 220   Accuracy:

40.91%

  Difficulty: Easy   Marks: 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

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

Contributor: Hardik Gulati
Author: AdityaChatterjee


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.