cf/mirror

Yet Yet Another Permutation Problem

CF
1936E3400· legendary gm5s1024 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
6
2
2 1
3
1 2 3
3
3 1 2
4
2 4 1 3
5
3 5 1 4 2
15
6 13 2 8 7 11 1 3 9 15 4 5 12 10 14
Output
1
3
2
4
18
424488915
1936E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)