cf/mirror

Yet Another Problem

CF
1747D1900· candidate master1s256 MB⌨ stdin/stdout

Examples

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