{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eRyuji is not a good student, and he doesn\u0027t want to study. But there are n books he should learn, each book has its knowledge $a[i]$.\u003c/p\u003e\u003cp\u003eUnfortunately, the longer he learns, the fewer he gets.\u003c/p\u003e\u003cp\u003eThat means, if he reads books from $l$ to $r$, he will get $a[l] \\times L + a[l+1] \\times (L-1) + \\cdots + a[r-1] \\times 2 + a[r]$ ($L$ is the length of [ $l$, $r$ ] that equals to $r - l + 1$).\u003c/p\u003e\u003cp\u003eNow Ryuji has $q$ questions, you should answer him:\u003c/p\u003e\u003cp\u003e$1$. If the question type is $1$, you should answer how much knowledge he will get after he reads books [ $l$, $r$ ].\u003c/p\u003e\u003cp\u003e$2$. If the question type is $2$, Ryuji will change the ith book\u0027s knowledge to a new value.\u003c/p\u003e\u003ch3\u003eInput\u003c/h3\u003e\u003cp\u003eFirst line contains two integers $n$ and $q$ ($n$, $q \\le 100000$).\u003c/p\u003e\u003cp\u003eThe next line contains n integers represent $a[i]( a[i] \\le 1e9)$ .\u003c/p\u003e\u003cp\u003eThen in next $q$ line each line contains three integers $a$, $b$, $c$, if $a \u003d 1$, it means question type is $1$, and $b$, $c$ represents [ $l$ , $r$ ]. if $a \u003d 2$ , it means question type is $2$ , and $b$, $c$ means Ryuji changes the bth book\u0027 knowledge to $c$\u003c/p\u003e\u003ch3\u003eOutput\u003c/h3\u003e\u003cp\u003eFor each question, output one line with one integer represent the answer.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","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 3\n1 2 3 4 5\n1 1 3\n2 5 0\n1 4 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e10\n8\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}