cf/mirror

Eating Queries

CF
1676E1100· newbie3.5s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
3
8 7
4 3 3 1 1 4 5 9
1
10
50
14
15
22
30
4 1
1 2 3 4
3
1 2
5
4
6
Output
1
2
-1
2
3
4
8
1
1
-1
1676E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)