Two Permutations (Easy Version)
1882E12400· grandmaster2s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
3 52 1 35 2 1 4 3
Output
23 42 4
Sample 2of 3
Input
4 43 4 2 12 4 1 3
Output
54 23 31 43 24 1
Sample 3of 3
Input
2 21 22 1
Output
-1
58%
1882E1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)