{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"So, you\u0027ve got a sequence of numbers, and you need to perform the following two operations:\n\n- Add a certain number to a specific number in the sequence $x$\n\n- Calculate the sum of numbers in a certain range"}},{"title":"Input","value":{"format":"MD","content":"The first line contains two positive integers $n,m$, representing the number of numbers in the sequence and the total number of operations.\n\nThe second line contains $n$ integers separated by spaces, where the $i$th number represents the initial value of the $i$th item in the sequence.\n\nThe next $m$ lines each contain $3$ integers, representing an operation, as follows:\n\n- `1 x k`: Meaning, add $k$ to the $x$th number\n\n- `2 x y`: Meaning, output the sum of each number in the range $[x,y]$"}},{"title":"Output","value":{"format":"MD","content":"Output several lines of integers, which are the results of all $2$ operations."}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 5\n1 5 4 2 3\n1 1 3\n2 2 5\n1 3 -1\n1 4 2\n2 1 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e14\n16\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Hint","value":{"format":"MD","content":"【Data Range】\n\nFor $30\\%$ data, $1 \\le n \\le 8$, $1\\le m \\le 10$; \nFor $70\\%$ data, $1\\le n,m \\le 10^4$; \nFor $100\\%$ data, $1\\le n,m \\le 5\\times 10^5$.\n\nIt is guaranteed that for any moment, any sub-range of $a$\u0027s (including sub-ranges of length $1$ and $n$) are within the range of $[-2^{31}, 2^{31})$.\n\nExample Explanation:\n\n ![](CDN_BASE_URL/2c875334b76041f6e8cfad71a05aeb71?v\u003d1706286762) \n\nHence, the output results are 14 and 16."}}]}