cf/mirror

Fixed Prefix Permutations

CF
1792D1700· expert2s256 MB⌨ stdin/stdout

Examples

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