#arc145c. [arc145_c]Split and Maximize
[arc145_c]Split and Maximize
Problem Statement
The score of a permutation of is defined as follows:
Consider dividing into two (not necessarily contiguous) subsequences and . The score of is the maximum possible value of in such a division.
Let be the maximum among the scores of all permutations of . Find the number, modulo , of permutations of with the score of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2
Sample Output 1
16
The maximum among the scores of the possible permutations, , is , and there are permutations with the score of .
For instance, the permutation achieves in the division .
Sample Input 2
10000
Sample Output 2
391163238
Print the count modulo .