cf/mirror

Permutation Counting

CF
1967A1400· specialist2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
8
1 10
1
2 4
8 4
3 4
6 1 8
3 9
7 6 2
5 3
6 6 7 4 6
9 7
7 6 1 7 6 2 4 3 3
10 10
1 3 1 2 1 9 3 5 7 5
9 8
5 8 7 5 1 3 2 9 8
Output
11
15
15
22
28
32
28
36
1967A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)