Task
While their car was lost in Panama, Carlos and Pablo decided to have fun with some math. One day, Carlos came up with what he called a Panama sum.
Basically, a Panama sum is the sum of some values in an -indexed array, where the values on the odd positions are added to the sum and the values on the even positions are subtracted from the sum.
For example, the Panama sum of the array is - + - + - which is equal to
Because finding this is way too easy for Pablo (he is a programmer), he decided to make this challenge more difficult.
Therefore, he invented the maximum Panama sum, which is defined as the maximum Panama sum we can get if we select a non-empty subarray from a given array.
Now he wants Carlos to find this value for multiple queries which might involve changing some values as well.
Help Carlos get this problem done and he will take you for a ride once he finds his car!
Input
The first line of the input consists of two integers, and .
The second line of the input consists of integers, representing the initial array .
The next lines of the input contain the queries you are given.
On each line, you will get the description of a query, which can be of two types:
- the value on position is changed to .
- find the maximum Panama sum of the subarray .
Output
The output will contain as many lines as queries of type exist in the input (there is at least one query of type ). Each line will contain the answer to a query, in the order they were given in the input.
Restrictions
- For tests worth points, , .
- For tests worth more points, , .
Example
stdin
10 6
5 9 1 2 3 4 6 4 2 8
2 3 7
2 4 10
2 6 9
1 5 8
2 1 10
2 4 6
stdout
6
10
6
10
8