{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"\u003ch3\u003e Read problems statements in \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/SEPT14/mandarin/QRECT.pdf\"\u003eMandarin Chinese \u003c/a\u003e and \u003ca target\u003d\"_blank\" href\u003d\"https://www.codechef.com/download/translated/SEPT14/russian/QRECT.pdf\"\u003eRussian\u003c/a\u003e.\u003c/h3\u003e\n\u003cp\u003eYou are given a Cartesian plane, and you are asked to support the following three kinds of operations:\u003c/p\u003e\n\u003cp\u003e\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eI x1 y1 x2 y2\u003c/strong\u003e: add an axes-parallel rectangle on the plane. The bottom-left corner has coordinates \u003cb\u003e(x1, y1)\u003c/b\u003e, the top-right one has coordinates \u003cb\u003e(x2, y2)\u003c/b\u003e \u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eD index\u003c/strong\u003e: remove the retangle that was added during the \u003cstrong\u003eindex\u003c/strong\u003e-th addition operation\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eQ x1 y1 x2 y2\u003c/strong\u003e: output the number of rectangles on the plane that have the common area with the rectangle with a bottom-left corner coordinates \u003cb\u003e(x1, y1)\u003c/b\u003e and a top-right corner coordinates \u003cb\u003e(x2, y2)\u003c/b\u003e.\u003cbr /\u003e\nPlease notice that, even if the two rectangles only share a common point, they are still regarded as sharing common area\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\u003cp\u003eAlso, there can be a few same rectangles on the plane, they should be regarded as a few different rectangles.\u003c/p\u003e\n\u003cp\u003eThere are \u003cstrong\u003eQ\u003c/strong\u003e operations in all, can you fulfill them?\u003c/p\u003e\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eThe first line contains an integer \u003cstrong\u003eQ\u003c/strong\u003e.\u003c/p\u003e\n\u003cp\u003eThe next \u003cstrong\u003eQ\u003c/strong\u003e lines represent the operations you are to deal with. Each of them contains an operation in one of the three forms above.\u003c/p\u003e\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eFor each \u003cstrong\u003eQ\u003c/strong\u003e-type operation, output the result on the separate line of the output.\u003c/p\u003e\n\u003ch3\u003eConstraints\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cspan style\u003d\"font-size: 10px;\"\u003e1 \u003c\u003d \u003cstrong\u003eQ \u003c/strong\u003e\u003c\u003d 100000\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003cspan style\u003d\"font-size: 10px;\"\u003e1 \u003c\u003d \u003cstrong\u003ex1\u003c/strong\u003e \u003c\u003d \u003cstrong\u003ex2\u003c/strong\u003e \u003c\u003d 10\u003csup\u003e9\u003c/sup\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003cspan style\u003d\"font-size: 10px;\"\u003e1 \u003c\u003d \u003cstrong\u003ey1\u003c/strong\u003e \u003c\u003d \u003cstrong\u003ey2\u003c/strong\u003e \u003c\u003d 10\u003csup\u003e9\u003c/sup\u003e\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv\u003e\n\u003ch3\u003eExample\u003c/h3\u003e\n\u003ch3\u003e\n\u003cpre style\u003d\"font-size: 12px; font-weight: normal;\"\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\n5\nI 1 1 2 2\nI 2 2 3 3\nQ 3 3 4 4 \nD 2\nQ 3 3 4 4\n\n\u003cstrong\u003eOutput:\u003c/strong\u003e\n1\n0 \u003c/pre\u003e\u003c/h3\u003e\n\u003ch3\u003eExplanation\u003c/h3\u003e\n\u003c/div\u003e\n\u003cpre\u003eIn the third operation, the rectangle (2, 2)-(3, 3) has a common point with the given rectangle.\nBut in the fifth operation, as the rectangle (2, 2)-(3, 3) has been removed, so there are no rectangles that has the common area with the given rectangle.\u003c/pre\u003e"}}]}