#3339. Rmq Problem

Rmq Problem

题目描述

img2

输入格式

img3

输出格式

img4

7 5
0 2 1 0 1 3 2
1 3
2 3
1 4
3 6
2 7

3
0
3
2
4

提示

img1

题目来源

By Xhr