cf/mirror

Splittable Permutations

CF
1976E2500· grandmaster2s512 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
6 3
6 4 4
5 5 2
Output
30
Sample 2of 3
Input
10 1
10
9
Output
1814400
Sample 3of 3
Input
4 1
2
4
Output
8
1976E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…