cf/mirror

River Locks

CF
1700D1900· candidate master2s256 MB⌨ stdin/stdout

Examples

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