atcoder#ARC145C. [ARC145C] Split and Maximize
[ARC145C] Split and Maximize
Score : points
Problem Statement
The score of a permutation of is defined as follows:
$$P$$$$A = (A_1,A_2,\ldots,A_N)$$$$B = (B_1,B_2,\ldots,B_N)$$$$P$$$$\displaystyle\sum_{i=1}^{N}A_i B_i$$Let $M$ be the maximum among the scores of all permutations of $(1,2,\ldots,2N)$. Find the number, modulo $998244353$, of permutations of $(1,2,\ldots,2N)$ with the score of $M$. $$
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
2
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 .
10000
391163238
Print the count modulo .