atcoder#AGC059F. [AGC059F] LIDS
[AGC059F] LIDS
Score : points
Problem Statement
Given , find the number of permutations of that satisfy all of the following conditions, modulo :
Here, denotes the length of the longest increasing subsequence of , and denotes the length of the longest decreasing subsequence of .
Constraints
- All values in the input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 2 2
2
The following permutations satisfy the conditions: .
4 1 1
6
The following permutations satisfy the conditions: $(1, 2, 3, 4), (1, 2, 4, 3), (1, 3, 2, 4), (1, 3, 4, 2), (1, 4, 2, 3), (1, 4, 3, 2)$.
5 2 5
11
2022 69 420
128873576