{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003ch2\u003eProblem C\n\n\u003c/h2\u003e\n\n\u003cp\u003e\nThe factory of the Impractically Complicated Products Corporation has many manufacturing lines and the same number of corresponding storage rooms. The same number of conveyor lanes are laid out in parallel to transfer goods from manufacturing lines directly to the corresponding storage rooms. Now, they plan to install a number of robot arms here and there between pairs of adjacent conveyor lanes so that goods in one of the lanes can be picked up and released down on the other, and also in the opposite way. This should allow mixing up goods from different manufacturing lines to the storage rooms.\n\u003c/p\u003e\n\n\u003cp\u003e\nDepending on the positions of robot arms, the goods from each of the manufacturing lines can only be delivered to some of the storage rooms. Your task is to find the number of manufacturing lines from which goods can be transferred to each of the storage rooms, given the number of conveyor lanes and positions of robot arms.\n\u003c/p\u003e\n\n\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003e\nThe input consists of a single test case, formatted as follows.\u003cbr\u003e\n\u003cbr\u003e\n$n$ $m$\u003cbr\u003e\n$x_1$ $y_1$\u003cbr\u003e\n...\u003cbr\u003e\n$x_m$ $y_m$\u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\nAn integer $n$ ($2 \\leq n \\leq 200000$) in the first line is the number of conveyor lanes. The lanes are numbered from 1 to $n$, and two lanes with their numbers differing with 1 are adjacent. All of them start from the position $x \u003d 0$ and end at $x \u003d 100000$. The other integer $m$ ($1 \\leq m \u0026lt; 100000$) is the number of robot arms.\n\u003c/p\u003e\n\n\u003cp\u003e\nThe following $m$ lines indicate the positions of the robot arms by two integers $x_i$ ($0 \u0026lt; x_i \u0026lt; 100000$) and $y_i$ ($1 \\leq y_i \u0026lt; n$). Here, $x_i$ is the \u003ci\u003ex\u003c/i\u003e-coordinate of the $i$-th robot arm, which can pick goods on either the lane $y_i$ or the lane $y_i + 1$ at position $x \u003d x_i$, and then release them on the other at the same \u003ci\u003ex\u003c/i\u003e-coordinate.\n\u003c/p\u003e\n\n\u003cp\u003e\nYou can assume that positions of no two robot arms have the same $x$-coordinate, that is, $x_i \\ne x_j$ for any $i \\ne j$.\n\u003c/p\u003e\n\n\u003ccenter\u003e\n\u003cimg src\u003d\"CDN_BASE_URL/84d639cf15bbeb54db0a7dfea76ad0d7?v\u003d1715572847\"\u003e\u003cbr\u003e\nFigure C.1. Illustration of Sample Input 1\n\u003c/center\u003e\u003cbr\u003e\n\n\n\u003ch3\u003eOutput\u003c/h3\u003e\n\n\u003cp\u003e\nOutput $n$ integers separated by a space in one line. The $i$-th integer is the number of the manufacturing lines from which the storage room connected to the conveyor lane $i$ can accept goods.\n\u003c/p\u003e\n\n\n\n\u003ch3\u003eSample Input 1\u003c/h3\u003e\n\n\u003cpre\u003e4 3\n1000 1\n2000 2\n3000 3\u003c/pre\u003e\n\n\u003ch3\u003eSample Output 1\u003c/h3\u003e\n\n\u003cpre\u003e2 3 4 4\u003c/pre\u003e\n\n\u003cbr\u003e\n\n\u003ch3\u003eSample Input 2\u003c/h3\u003e\n\n\u003cpre\u003e4 3\n1 1\n3 2\n2 3\u003c/pre\u003e\n\n\u003ch3\u003eSample Output 2\u003c/h3\u003e\n\n\u003cpre\u003e2 4 4 2\u003c/pre\u003e\n\n"}}]}