{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eDZY loves colors, and he enjoys painting.\u003c/span\u003e\u003c/p\u003e\u003cp\u003eOn a colorful day, DZY gets a colorful ribbon, which consists of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e units (they are numbered from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e from left to right). The color of the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th unit of the ribbon is \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e at first. It is colorful enough, but we still consider that the colorfulness of each unit is \u003cspan class\u003d\"tex-span\"\u003e0\u003c/span\u003e at first.\u003c/p\u003e\u003cp\u003eDZY loves painting, we know. He takes up a paintbrush with color \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e and uses it to draw a line on the ribbon. In such a case some contiguous units are painted. Imagine that the color of unit \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e currently is \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ey\u003c/i\u003e\u003c/span\u003e. When it is painted by this paintbrush, the color of the unit becomes \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e, and the colorfulness of the unit increases by \u003cspan class\u003d\"tex-span\"\u003e|\u003ci\u003ex\u003c/i\u003e - \u003ci\u003ey\u003c/i\u003e|\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eDZY wants to perform \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e operations, each operation can be one of the following:\u003c/p\u003e\u003col\u003e \u003cli\u003e Paint all the units with numbers between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003el\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003er\u003c/i\u003e\u003c/span\u003e (both inclusive) with color \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e. \u003c/li\u003e\u003cli\u003e Ask the sum of colorfulness of the units between \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003el\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003er\u003c/i\u003e\u003c/span\u003e (both inclusive). \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eCan you help DZY?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two space-separated integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e\u0026nbsp;(1 ≤ \u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e5\u003c/sup\u003e)\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eEach of the next \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e lines begins with a integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003etype\u003c/i\u003e\u0026nbsp;(1 ≤ \u003ci\u003etype\u003c/i\u003e ≤ 2)\u003c/span\u003e, which represents the type of this operation.\u003c/p\u003e\u003cp\u003eIf \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003etype\u003c/i\u003e \u003d 1\u003c/span\u003e, there will be \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003e more integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003el\u003c/i\u003e, \u003ci\u003er\u003c/i\u003e, \u003ci\u003ex\u003c/i\u003e\u0026nbsp;(1 ≤ \u003ci\u003el\u003c/i\u003e ≤ \u003ci\u003er\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e;\u0026nbsp;1 ≤ \u003ci\u003ex\u003c/i\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e8\u003c/sup\u003e)\u003c/span\u003e in this line, describing an operation \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eIf \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003etype\u003c/i\u003e \u003d 2\u003c/span\u003e, there will be \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e more integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003el\u003c/i\u003e, \u003ci\u003er\u003c/i\u003e\u0026nbsp;(1 ≤ \u003ci\u003el\u003c/i\u003e ≤ \u003ci\u003er\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e)\u003c/span\u003e in this line, describing an operation \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each operation \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e, print a line containing the answer — sum of colorfulness.\u003c/p\u003e"}},{"title":"Examples","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\u003e3 3\n1 1 2 4\n1 2 3 5\n2 1 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e3 4\n1 1 3 4\n2 1 1\n2 2 2\n2 3 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n2\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e10 6\n1 1 5 3\n1 2 7 9\n1 10 10 11\n1 3 8 12\n1 1 10 3\n2 1 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e129\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first sample, the color of each unit is initially \u003cspan class\u003d\"tex-span\"\u003e[1, 2, 3]\u003c/span\u003e, and the colorfulness is \u003cspan class\u003d\"tex-span\"\u003e[0, 0, 0]\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eAfter the first operation, colors become \u003cspan class\u003d\"tex-span\"\u003e[4, 4, 3]\u003c/span\u003e, colorfulness become \u003cspan class\u003d\"tex-span\"\u003e[3, 2, 0]\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eAfter the second operation, colors become \u003cspan class\u003d\"tex-span\"\u003e[4, 5, 5]\u003c/span\u003e, colorfulness become \u003cspan class\u003d\"tex-span\"\u003e[3, 3, 2]\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eSo the answer to the only operation of type \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e is \u003cspan class\u003d\"tex-span\"\u003e8\u003c/span\u003e.\u003c/p\u003e"}}]}