class DualSegTree(): def __init__(self,n,unit,f): self.n=n self.unit=unit self.data=[unit for _ in range(n*2)] self.f=f def propagate(self,i): if i>=self.n*2:return data,unit,f=self.data,self.unit,self.f c,j=0,i while j: j>>=1 c+=1 for j in range(c-1,0,-1): j=i>>j data[j+j]=f(data[j+j],data[j]) data[j-~j]=f(data[j-~j],data[j]) data[j]=unit def update(self,l,r,x): data,f=self.data,self.f l+=self.n r+=self.n self.propagate(l) self.propagate(r) while l>=1 r>>=1 def get(self,i): i+=self.n self.propagate(i) return self.data[i] def main(): import sys input=sys.stdin.buffer.readline n,q=map(int,input().split()) *a,=map(int,input().split()) b=[0]*n c=DualSegTree(n,0,lambda a,b:a+b) for _ in range(q): q,*x=input().split() x,y=map(int,x) x-=1 if q