atcoder#AGC036F. [AGC036F] Square Constraints
[AGC036F] Square Constraints
Score : points
Problem Statement
Given is an integer . How many permutations of satisfy the following condition?
- For each , holds.
Since the number can be enormous, compute it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of permutations that satisfy the condition, modulo .
2 998244353
4
Four permutations satisfy the condition:
10 998244353
53999264
200 998244353
112633322