output_description: For each query of the latter type, print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N Q
      a_0 a_1 ... a_{N - 1}
      \textrm{Query}_0
      \textrm{Query}_1
      :
      \textrm{Query}_{Q - 1}
attempt: import sys
  
  input = sys.stdin.readline
  
  
  def solve():
      def makeBIT(numEle):
          numPow2 = 2 ** (numEle - 1).bit_length()
          data = [0] * (numPow2 + 1)
          return data, numPow2
  
      def setInit(As):
          for iB, A in enumerate(As, 1):
              data[iB] = A
          for iB in range(1, numPow2):
              i = iB + (iB & -iB)
              data[i] += data[iB]
  
      def addValue(iA, A):
          iB = iA + 1
          while iB <= numPow2:
              data[iB] += A
              iB += iB & -iB
  
      def getSum(iA):
          iB = iA + 1
          ans = 0
          while iB > 0:
              ans += data[iB]
              iB -= iB & -iB
          return ans
  
      def getRangeSum(iFr, iTo):
          return getSum(iTo) - getSum(iFr - 1)
  
      N, Q = map(int, input().split())
      As = list(map(int, input().split()))
  
      data, numPow2 = makeBIT(N)
      setInit(As)
  
      anss = []
      for _ in range(Q):
          t, i, j = map(int, input().split())
          if t == 0:
              addValue(i, j)
          else:
              anss.append(getRangeSum(i, j - 1))
  
      print("\n".join(map(str, anss)))
  
  
  solve()
  
problem_description: Statement
  
  You are given an array a_0, a_1, ..., a_{N-1} of length N. Process Q queries
  of the following types.
  
    * `0 p x`: a_p \gets a_p + x
    * `1 l r`: Print \sum_{i = l}^{r - 1}{a_i}.
samples: [{"input": "5 5\n    1 2 3 4 5\n    1 0 5\n    1 2 4\n    0 3 10\n    1 0 5\n    1 0 3", "output": "15\n    7\n    25\n    6"}]