Optimistic Permutations

0

0 votes
Problem

Let  be a permutation of .

An optimistic permutation follows .

An over-optimistic permutation has the following properties:

  • It is optimistic.
  • There exists atleast one  such that  .

Given , find the count of all over-optimistic permutations modulo .

Input:

The first line contains  - the number of testcases, followed by T lines each containing one integer .

Output:

For each testcase print the answer on a newline.

Constraints:

Sample Input
2
1
3
Sample Output
0
1
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

For , the only possible over-optimistic permutation is .

Editor Image

?