cf/mirror

Special Permutation

CF
1612B900· newbie2s512 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
7
6 2 5
6 1 3
6 4 3
4 2 4
10 5 3
2 1 2
2 2 1
Output
4 2 6 5 3 1
-1
6 4 5 1 3 2
3 2 4 1
-1
1 2
2 1
1612B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)