cf/mirror

Maximum And Queries (hard version)

CF
1903D22500· grandmaster7s512 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4 2
1 3 7 5
2
10
Output
2
6
Sample 2of 3
Input
3 5
4 0 2
9
8
17
1
3
Output
5
4
7
0
1
Sample 3of 3
Input
1 2
10
5
2318381298321
Output
15
2318381298331
1903D2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)