You are given an array consists of elements.
You have to perform queries on the array.
For this type of queries, you have to set = . Here, is an index of array .
For this type of queries, you have to find the minimum , so that or say is it impossible to find such .
The first line contains two integers and () represents the size of array and number of queries to perform respectively.
The next line contains space separated integers ().
The next lines consists of one of two types of queries.
For the second type of query print the minimum or if it is impossible to find such in separate lines.
5 5 1 5 3 2 4 Query 2 8 Update 3 1 Query 2 8 Query 4 1 Query 4 10
3 4 4 -1
Login to submit
If you know Square Root Decomposition algorithm, then this problem will be a piece of cake for you. ...