cf/mirror

Xorcerer's Stones

CF
1779F2500· grandmaster4s512 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
2
13 13
1
Output
1
1
Sample 2of 3
Input
7
5 2 8 3 4 1 31
1 1 2 2 3 3
Output
-1
Sample 3of 3
Input
9
3 31 1 2 7 30 7 3 1
1 1 1 2 5 5 3 4
Output
6
3 2 3 1 2 2
1779F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…