GSS3  Can you answer these queries III
You are given a sequence A of N (N <= 50000) integers between 10000 and 10000. On this sequence you have to apply M (M <= 50000) operations:
modify the ith element in the sequence or for given x y print max{Ai + Ai+1 + .. + Aj  x<=i<=j<=y }.
Input
The first line of input contains an integer N. The following line contains N integers, representing the sequence A1..AN.
The third line contains an integer M. The next M lines contain the operations in following form:
0 x y: modify Ax into y (y<=10000).
1 x y: print max{Ai + Ai+1 + .. + Aj  x<=i<=j<=y }.
Output
For each query, print an integer as the problem required.
Example
Input: 4 1 2 3 4 4 1 1 3 0 3 3 1 2 4 1 3 3 Output: 6 4 3
hide comments
wargang:
20201208 10:32:06
One hell of a question!


noobestofnoob:
20201127 13:50:39
can any one explain me how the output: 6 4 3 came 

beowulf_rohan:
20200929 23:22:04
Can someone explain "Wrong Answer #0"...? 

harry_shit:
20200917 05:43:03
use long long int instead of int for ac 

sabal_nrl322:
20200907 16:16:58
If your code is giving the correct ans in your IDE but while submitting wrong ans on 8/9 Test Case


kushal_0189:
20200902 16:23:44
Use concept of Prefix and Suffix array sum


ankhang277:
20200827 13:11:59
Test for some one stuck


codefucker1307:
20200805 21:15:06
a lot of WA attempts at GSS1 helped me in doing it in ONE go.


anonymousamigo:
20200803 06:52:25
help for those who got stuck


vandan6500:
20200713 09:19:39
GSS1 before this is a must 
Added by:  Bin Jin 
Date:  20070803 
Time limit:  1s 
Source limit:  5000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: CPP 
Resource:  own problem 