cf/mirror

Periodic RMQ Problem

CF
803G2300· international master4s512 MB⌨ stdin/stdout

Examples

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