cf/mirror

Restricted Sorting

CF
2187A1300· pupil2s256 MB⌨ stdin/stdout

Examples

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