{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"给你一串序列,每次对它有四种操作,\u003cbr\u003e\n1.C l r d:将l到r之间所有的数+d,同时时间戳+1。\u003cbr\u003e\n2.Q l r:查询当前时间戳下l到r的所有数的总和。\u003cbr\u003e\n3.H l r t:.查询时间戳t下的l到r的所有数的和。\u003cbr\u003e\n4.B t:将时间戳返回至t。"}},{"title":"Input","value":{"format":"HTML","content":"n m \n\u003cbr\u003eA \n\u003csub\u003e1\u003c/sub\u003e A \n\u003csub\u003e2\u003c/sub\u003e ... A \n\u003csub\u003en\u003c/sub\u003e \n\u003cbr\u003e... (here following the m operations. )"}},{"title":"Output","value":{"format":"HTML","content":"... (for each query, simply print the result. )"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\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\n2 4\n0 0\nC 1 1 1\nC 2 2 -1\nQ 1 2\nH 1 2 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e4\n55\n9\n15\n0\n1\u003c/pre\u003e"}}]}