{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"Painting some colored segments on a line, some previously painted segments may \nbe covered by some the subsequent ones. \n\u003cp\u003eYour task is counting the segments of different colors you can see at last.\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003e\n \u003cb\u003eInput\u003cbr\u003e\n \u003c/b\u003e\u003cbr\u003e\n The first line of each data set contains exactly one integer n, 1 \u0026lt;\u003d n \u0026lt;\u003d \n 8000, equal to the number of colored segments.\u003c/p\u003e\n\u003cp\u003eEach of the following n lines consists of exactly 3 nonnegative integers separated \n by single spaces:\u003cbr\u003e\n \u003cbr\u003e\n x1 x2 c\u003cbr\u003e\n \u003cbr\u003e\n x1 and x2 indicate the left endpoint and right endpoint of the segment, c indicates \n the color of the segment.\u003c/p\u003e\n\u003cp\u003eAll the numbers are in the range [0, 8000], and they are all integers.\u003c/p\u003e\n\u003cp\u003eInput may contain several data set, process to the end of file.\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003e\n \u003cb\u003eOutput\u003c/b\u003e\u003cbr\u003e\n \u003cbr\u003e\n Each line of the output should contain a color index that can be seen from the \n top, following the count of the segments of this color, they should be printed \n according to the color index.\u003c/p\u003e\n\u003cp\u003eIf some color can\u0027t be seen, you shouldn\u0027t print it.\u003c/p\u003e\n\u003cp\u003ePrint a blank line after every dataset.\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003e\n \u003cb\u003eSample Input\u003c/b\u003e\u003cbr\u003e\n \u003cbr\u003e\n 5\u003cbr\u003e\n 0 4 4\u003cbr\u003e\n 0 3 1\u003cbr\u003e\n 3 4 2\u003cbr\u003e\n 0 2 2\u003cbr\u003e\n 0 2 3\u003cbr\u003e\n 4\u003cbr\u003e\n 0 1 1\u003cbr\u003e\n 3 4 1\u003cbr\u003e\n 1 3 2\u003cbr\u003e\n 1 3 1\u003cbr\u003e\n 6\u003cbr\u003e\n 0 1 0\u003cbr\u003e\n 1 2 1\u003cbr\u003e\n 2 3 1\u003cbr\u003e\n 1 2 0\u003cbr\u003e\n 2 3 0\u003cbr\u003e\n 1 2 1\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003e\n \u003cb\u003eSample Output\u003c/b\u003e\u003cbr\u003e\n \u003cbr\u003e\n 1 1\u003cbr\u003e\n 2 1\u003cbr\u003e\n 3 1\u003c/p\u003e\n\u003cp\u003e1 1\u003c/p\u003e\n\u003cp\u003e0 2\u003cbr\u003e\n 1 1\u003c/p\u003e\n\u003cp\u003e\u003cbr\u003e\n\u003c/p\u003e\n"}}]}