Problem Description

You have an array of n integers. Support two operations: ADD i x (a[i]+=x) and SUM l r (inclusive). Print answers for SUM queries.

Input Format

Line1: n q. Line2: n integers. Next q lines commands.

Output Format

Outputs for SUM.

Sample Test Case

Input:
5 5 1 2 3 4 5 SUM 1 3 ADD 2 10 SUM 0 4 SUM 2 2 ADD 4 -5
Output:
9 25 13

Constraints

n,q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next