{"raw_statement":[{"iden":"statement","content":"You are given $n$ segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide.\n\nYour task is the following: for every $k \\in [1..n]$, calculate the number of points with integer coordinates such that the number of segments that cover these points equals $k$. A segment with endpoints $l_i$ and $r_i$ covers point $x$ if and only if $l_i \\le x \\le r_i$."},{"iden":"input","content":"The first line of the input contains one integer $n$ ($1 \\le n \\le 2 \\cdot 10^5$) — the number of segments.\n\nThe next $n$ lines contain segments. The $i$\\-th line contains a pair of integers $l_i, r_i$ ($0 \\le l_i \\le r_i \\le 10^{18}$) — the endpoints of the $i$\\-th segment."},{"iden":"output","content":"Print $n$ space separated integers $cnt_1, cnt_2, \\dots, cnt_n$, where $cnt_i$ is equal to the number of points such that the number of segments that cover these points equals to $i$."},{"iden":"examples","content":"Input\n\n3\n0 3\n1 3\n3 8\n\nOutput\n\n6 2 1 \n\nInput\n\n3\n1 3\n2 4\n5 7\n\nOutput\n\n5 2 0"},{"iden":"note","content":"The picture describing the first example:\n\n![image](https://espresso.codeforces.com/b3d344391aaf4b5f28e61d5120f885c1bdfa2449.png)\n\nPoints with coordinates $[0, 4, 5, 6, 7, 8]$ are covered by one segment, points $[1, 2]$ are covered by two segments and point $[3]$ is covered by three segments.\n\nThe picture describing the second example:\n\n![image](https://espresso.codeforces.com/c76c8c48121e90f23f1bd1fd7326deba7278dccf.png)\n\nPoints $[1, 4, 5, 6, 7]$ are covered by one segment, points $[2, 3]$ are covered by two segments and there are no points covered by three segments."}],"translated_statement":[{"iden":"statement","content":"给定数轴上的 $n$ 个线段；每个线段的端点坐标均为整数。某些线段可能退化为点。线段之间可以相交、嵌套甚至重合。\n\n你的任务如下：对于每个 $k \\in [1..n]$，计算满足“恰好被 $k$ 个线段覆盖”的整数坐标点的个数。一个端点为 $l_i$ 和 $r_i$ 的线段覆盖点 $x$，当且仅当 $l_i \\leq x \\leq r_i$。\n\n输入的第一行包含一个整数 $n$（$1 \\leq n \\leq 2 \\cdot 10^5$）——线段的数量。\n\n接下来的 $n$ 行每行包含一个线段。第 $i$ 行包含一对整数 $l_i, r_i$（$0 \\leq l_i \\leq r_i \\leq 10^{18}$）——第 $i$ 个线段的端点。\n\n请输出 $n$ 个用空格分隔的整数 $cnt_1, cnt_2, \\dots, cnt_n$，其中 $cnt_i$ 表示恰好被 $i$ 个线段覆盖的整数点的个数。\n\n第一个示例的图示：\n\n\n\n坐标为 $[0, 4, 5, 6, 7, 8]$ 的点被一个线段覆盖，坐标为 $[1, 2]$ 的点被两个线段覆盖，坐标为 $[3]$ 的点被三个线段覆盖。\n\n第二个示例的图示：\n\n\n\n坐标为 $[1, 4, 5, 6, 7]$ 的点被一个线段覆盖，坐标为 $[2, 3]$ 的点被两个线段覆盖，没有点被三个线段覆盖。"},{"iden":"input","content":"输入的第一行包含一个整数 $n$（$1 \\leq n \\leq 2 \\cdot 10^5$）——线段的数量。接下来的 $n$ 行每行包含一个线段。第 $i$ 行包含一对整数 $l_i, r_i$（$0 \\leq l_i \\leq r_i \\leq 10^{18}$）——第 $i$ 个线段的端点。"},{"iden":"output","content":"请输出 $n$ 个用空格分隔的整数 $cnt_1, cnt_2, \\dots, cnt_n$，其中 $cnt_i$ 表示恰好被 $i$ 个线段覆盖的整数点的个数。"},{"iden":"examples","content":"输入：\n3\n0 3\n1 3\n3 8\n输出：\n6 2 1\n\n输入：\n3\n1 3\n2 4\n5 7\n输出：\n5 2 0 "},{"iden":"note","content":"第一个示例的图示：坐标为 $[0, 4, 5, 6, 7, 8]$ 的点被一个线段覆盖，坐标为 $[1, 2]$ 的点被两个线段覆盖，坐标为 $[3]$ 的点被三个线段覆盖。\n\n第二个示例的图示：坐标为 $[1, 4, 5, 6, 7]$ 的点被一个线段覆盖，坐标为 $[2, 3]$ 的点被两个线段覆盖，没有点被三个线段覆盖。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of segments.  \nFor each $ i \\in \\{1, \\dots, n\\} $, let $ [l_i, r_i] $ be a closed integer interval with $ l_i, r_i \\in \\mathbb{Z} $, $ 0 \\le l_i \\le r_i \\le 10^{18} $.  \n\nLet $ \\mathcal{S} = \\{ [l_i, r_i] \\mid i = 1, \\dots, n \\} $ be the set of segments.  \nFor any integer point $ x \\in \\mathbb{Z} $, define the coverage count:  \n$$\nc(x) = \\left| \\left\\{ i \\in \\{1, \\dots, n\\} \\mid l_i \\le x \\le r_i \\right\\} \\right|\n$$\n\nFor each $ k \\in \\{1, \\dots, n\\} $, define:  \n$$\n\\text{cnt}_k = \\left| \\left\\{ x \\in \\mathbb{Z} \\mid c(x) = k \\right\\} \\right|\n$$\n\n**Constraints**  \n1. $ 1 \\le n \\le 2 \\cdot 10^5 $  \n2. For all $ i \\in \\{1, \\dots, n\\} $: $ 0 \\le l_i \\le r_i \\le 10^{18} $  \n\n**Objective**  \nCompute the vector $ (\\text{cnt}_1, \\text{cnt}_2, \\dots, \\text{cnt}_n) $.","simple_statement":null,"has_page_source":false}