{"trustable":false,"sections":[{"title":"Tips","value":{"format":"MD","content":"# 翻译在下方"}},{"title":"","value":{"format":"MD","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eYou have \u003ci\u003eN\u003c/i\u003e integers, \u003ci\u003eA\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003eA\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, ... , \u003ci\u003eA\u003csub\u003eN\u003c/sub\u003e\u003c/i\u003e. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"MD","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eThe first line contains two numbers \u003ci\u003eN\u003c/i\u003e and \u003ci\u003eQ\u003c/i\u003e. 1 ≤ \u003ci\u003eN\u003c/i\u003e,\u003ci\u003eQ\u003c/i\u003e ≤ 100000.\u003cbr\u003eThe second line contains \u003ci\u003eN\u003c/i\u003e numbers, the initial values of \u003ci\u003eA\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003eA\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, ... , \u003ci\u003eA\u003csub\u003eN\u003c/sub\u003e\u003c/i\u003e. -1000000000 ≤ \u003ci\u003eA\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 1000000000.\u003cbr\u003eEach of the next \u003ci\u003eQ\u003c/i\u003e lines represents an operation.\u003cbr\u003e\"C \u003ci\u003ea\u003c/i\u003e \u003ci\u003eb\u003c/i\u003e \u003ci\u003ec\u003c/i\u003e\" means adding \u003ci\u003ec\u003c/i\u003e to each of \u003ci\u003eA\u003csub\u003ea\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003eA\u003csub\u003ea\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e+1\u003c/sub\u003e, ... , \u003ci\u003eA\u003csub\u003eb\u003c/sub\u003e\u003c/i\u003e. -10000 ≤ \u003ci\u003ec\u003c/i\u003e ≤ 10000.\u003cbr\u003e\"Q \u003ci\u003ea\u003c/i\u003e \u003ci\u003eb\u003c/i\u003e\" means querying the sum of \u003ci\u003eA\u003csub\u003ea\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003eA\u003csub\u003ea\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e+1\u003c/sub\u003e, ... , \u003ci\u003eA\u003csub\u003eb\u003c/sub\u003e\u003c/i\u003e.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eYou need to answer all \u003ci\u003eQ\u003c/i\u003e commands in order. One answer in a line.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"MD","content":"\u003cpre class\u003d\"sio\"\u003e10 5\n1 2 3 4 5 6 7 8 9 10\nQ 4 4\nQ 1 10\nQ 2 4\nC 3 6 3\nQ 2 4\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"MD","content":"\u003cpre class\u003d\"sio\"\u003e4\n55\n9\n15\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"MD","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe sums may exceed the range of 32-bit integers.\u003c/div\u003e"}},{"title":"翻译","value":{"format":"MD","content":"### 题目描述\n\n队长给出了一个序列,想让你帮队长干活,你需要处理如下两种情况:\n\n\"C a b c\"表示给$[a, b]$区间中的值全部增加$c (-10000 ≤ c ≤ 10000)$。\n\n\"Q a b\" 询问$[a, b]$区间中所有值的和。\n\n### 输入格式\n\n第一行包含两个整数$N, Q$。$1 ≤ N,Q ≤ 100000$\n\n第二行包含$N$个整数,表示初始的序列$A (-1000000000 ≤ A_i ≤ 1000000000)$。\n\n接下来$Q$行询问,格式如题目描述。\n\n### 输出格式\n\n对于每一个$Q$开头的询问,你需要输出相应的答案,每个答案一行。\n\n### 样例输入 #1\n\n```text\n10 5\n1 2 3 4 5 6 7 8 9 10\nQ 4 4\nQ 1 10\nQ 2 4\nC 3 6 3\nQ 2 4\n```\n\n### 样例输出 #1\n\n```text\n4\n55\n9\n15\n```\n\n### 说明和提示\n\n区间和有可能超过**$32$位整型**"}}]}