Given an array. We need to learn how to handle two types of requests.
* 1 L R
- flip segment [L,R]
* 2 L R
- find the minimum on the segment [L,R]
Input
The first line of the file contains two numbers n
, m
. (1<=n,m<=105) The second line contains n
numbers ni code> (1<=ai<=109) - source array. The remaining m
lines contain queries in the format described in the condition. The numbers L
, R
are restricted to (1<=L<=R<=n).
Output
For each request of type 2, print the answer to it in the input file on a separate line.
Examples
# |
Input |
Output |
1 |
10 7
5 3 2 3 12 6 7 5 10 12
2 4 9
1 4 6
2 1 8
1 1 8
1 8 9
2 1 7
2 3 6
|
3
2
2
2
|