PermutationsProblem code: TECH14 |
How many permutations of the first N numbers exist such that the maximum element between the indices [i..j] is either present at index i, or at index j ?
Input
The first line contains the number of test cases T (<=10000). Each of the next T lines contains an integer N (<= 1000000000)
Output
Output T lines containing the required answer for the corresponding test case. Since the answers can get really big, output the result modulo 1000000007.
Example
Input: 1 2 Output: 2
| Author: | technovanza10 |
| Date Added: | 24-01-2010 |
| Time Limit: | 2 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, C99 strict, CLOJ, CPP 4.0.0-8, CPP 4.3.2, F#, GO, JAVA, PERL6, PYTH 3.1.2, TEXT |
Comments

Fetching successful submissions
