cf/mirror

Restoring the Permutation

CF
1506E1500· specialist2s256 MB⌨ stdin/stdout

Examples

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