Problem: Alice has recently received an array for her birthday! She is very proud of her array, and when she showed her friend Bob the array, he was very happy with her present too!
However, soon Bob became curious, and as any sane friend would do, asked Alice to perform operations of two types on her array:
- : update the element to (set ).
- : calculate how many non-decreasing subarrays exist within the subarray . More formally, count the number of pairs of integers such that and .
Help Alice answer Bob's queries!
Input Format: The first line contains two integers and () — the size of the array, and the number of queries, respectively.
The second line contains integers () — the elements of Alice's array.
The next lines consist of three integers each. The first integer of the -th line is , the operation being performed on the -th step ( or ).
If , the next two integers are and (; ), updating the element at position to (setting ).
If , the next two integers are and (), the two indices Bob asks Alice about for the -th query.
It's guaranteed that there is at least one operation of the second type.
Output Format: For each query of type , print a single integer, the answer to the query.
Note: For the first query, and , and the non-decreasing subarrays are , , , , and .