A permutation of length
is an array of integers such that every integer from to appears in it exactly once.
We define a function over a permutation as follows:
You are given an integer . What is the expected value of the function over all possible permutations of length ?
The expected value of the function can be represented as a fraction of the form . You are required to print .
Input Format
- The first line of the input contains a single integer denoting the number of test cases. The description of test cases follows.
- The first and only line of each test case contains a single integer .
Output Format
For each test case, output on a single line the expected value of the function modulo .
Constraints
Sample Input 1
2
2
3
Sample Output 1
2
333333343
Explanation
Test Case : There are possible permutations: with and with . Hence the expected value of the function is .
Test Case : There are possible permutations, with the value of function as . Hence the expected value of the function is .
ConversionConversion EmoticonEmoticon