cf/mirror

Girl Permutation

CF
1946E2200· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
6
1 1 1
1
1
4 2 3
1 2
2 3 4
3 3 1
1 2 3
3
5 3 4
1 2 3
2 3 4 5
20 5 4
1 2 3 4 12
12 13 18 20
6 2 3
1 3
3 4 6
Output
1
3
1
0
317580808
10
1946E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)