Given an array
- Find the value and index of the smallest element from index
to index . If there are multiple smallest elements, find the index of the earliest one. - Update the element at index
to value .
Constraints
Input Specification
The first line contains
The second line contains
The next
M l r
representing the first operation.U i x
representing the second operation.
Output Specification
For each type
Sample Input
Copy
5 5
6 3 3 2 4
M 2 4
M 2 3
U 2 6
M 1 2
M 1 3
Sample Output
Copy
2 4
3 2
6 1
3 3
Comments