题目描述
Problem description.
The problem statement is simple , you are given an array and you have to perform two types of operation on it.
Type 1 : update the value of array at the given index.
Type 2 : find the maximum sum you can obtained in the given range ( L , R ) by taking any two index i and j , such that ( L <= i , j <= R ) and one of them is at odd position and other is at even positon.
Input
Input description.
The first line of the input contains an integer N and Q denoting the size of array and number of operations.
Next line contain array of N elements.
Next Q lines contains queries of type 1 and 2 .
Type 1 : 1 x y ( a[x] = y )
Type 2 : 2 L R ( find the requires answer).
Output
Output description.
For each query of type 2 , output your answer
Constraints :
1 ≤ N,Q,x,y ≤ 100000
1 ≤ a[i] ≤ 100000
1 ≤ L ≤ R ≤ 100000
Example
Input:
5 3
1 2 3 4 5
2 1 5
1 2 5
2 1 5
Output:
9
10
输入格式
见题面
输出格式
见题面