{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"There are $n$ lamps arranged in a row, numbered from left to right as: $1$,$2$,……,$n$. Then, $m$ operations are executed sequentially.\n\nThere are two types of operations:\n\n1. Specify a range $[a,b]$ and then change the state of the lamps within this range (turn off the lamps that are on, and turn on the lamps that are off);\n2. Specify a range $[a,b]$ and you are required to output how many lamps are on in this range.\n\n**All lamps are initially off.**"}},{"title":"Input","value":{"format":"MD","content":"The first line contains two integers $n$ and $m$, representing the number of lamps and the number of operations, respectively.\n\nThe next $m$ lines each contain three integers, which are: $c$、$a$、$b$. Here, $c$ indicates the type of operation.\n\n- When the value of $c$ is $0$, it indicates the first type of operation.\n- When the value of $c$ is $1$, it indicates the second type of operation.\n\n$a$ and $b$ represent the left and right boundaries of the operation range, respectively."}},{"title":"Output","value":{"format":"MD","content":"Each time the second type of operation is encountered, output a line containing an integer that indicates the number of lamps that are on in the queried range."}},{"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\u003e4 5\n0 1 2\n0 2 4\n1 2 3\n0 2 4\n1 1 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n2\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 Scale and Constraints\n\nFor all test cases, it is guaranteed that $2\\le n\\le 10^5$,$1\\le m\\le 10^5$,$1\\le a,b\\le n$,$c\\in\\{0,1\\}$."}}]}