#ds202. 线段树2
线段树2
Segment Tree 2
Problem Description
You are given numbers .
Support operations:
1 x d: set .2 l r: query the maximum subarray sum in , i.e. find that maximizes .
Input Format
The first line contains two integers ().
The next line contains integers ().
The next lines each contain an operation of the form 1 x d or 2 l r, with $1\leq x\leq n, 1\leq l\leq r\leq n, -10^9\leq d\leq 10^9$ guaranteed.
Output Format
For each query, output one line containing the answer.
Sample Input
5 5
-1 2 -3 4 -5
2 4 5
1 2 4
2 1 5
1 4 -1
2 2 4
Sample Output
4
5
4