{"raw_statement":[{"iden":"statement","content":"You are given an undirected graph consisting of _n_ vertices and edges. Instead of giving you the edges that exist in the graph, we give you _m_ unordered pairs (_x_, _y_) such that there is no edge between _x_ and _y_, and if some pair of vertices is not listed in the input, then there is an edge between these vertices.\n\nYou have to find the number of connected components in the graph and the size of each component. A connected component is a set of vertices _X_ such that for every two vertices from this set there exists at least one path in the graph connecting these vertices, but adding any other vertex to _X_ violates this rule."},{"iden":"input","content":"The first line contains two integers _n_ and _m_ (1 ≤ _n_ ≤ 200000, ).\n\nThen _m_ lines follow, each containing a pair of integers _x_ and _y_ (1 ≤ _x_, _y_ ≤ _n_, _x_ ≠ _y_) denoting that **there is no edge** between _x_ and _y_. Each pair is listed at most once; (_x_, _y_) and (_y_, _x_) are considered the same (so they are never listed in the same test). If some pair of vertices is not listed in the input, then there **exists** an edge between those vertices."},{"iden":"output","content":"Firstly print _k_ — the number of connected components in this graph.\n\nThen print _k_ integers — the sizes of components. You should output these integers in non-descending order."},{"iden":"example","content":"Input\n\n5 5\n1 2\n3 4\n3 2\n4 2\n2 5\n\nOutput\n\n2\n1 4"}],"translated_statement":[{"iden":"statement","content":"给定一个包含 #cf_span[n] 个顶点和若干条边的无向图。我们不直接给出图中存在的边，而是给出 #cf_span[m] 个无序对 (#cf_span[x, y])，表示 #cf_span[x] 和 #cf_span[y] 之间没有边；如果某对顶点未在输入中列出，则这两顶点之间存在一条边。\n\n你需要求出图中连通分量的数量以及每个连通分量的大小。连通分量是一个顶点集合 #cf_span[X]，满足该集合中任意两个顶点之间都存在至少一条路径相连，但向 #cf_span[X] 中添加任何其他顶点都会破坏这一性质。\n\n第一行包含两个整数 #cf_span[n] 和 #cf_span[m] (#cf_span[1 ≤ n ≤ 200000], )。\n\n接下来 #cf_span[m] 行，每行包含两个整数 #cf_span[x] 和 #cf_span[y] (#cf_span[1 ≤ x, y ≤ n], #cf_span[x ≠ y])，表示 #cf_span[x] 和 #cf_span[y] 之间 *没有边*。每对至多出现一次；(#cf_span[x, y]) 和 (#cf_span[y, x]) 被视为相同（因此在同一测试用例中不会同时出现）。如果某对顶点未在输入中列出，则这两顶点之间 *存在* 边。\n\n首先输出 #cf_span[k] —— 图中连通分量的数量。\n\n然后输出 #cf_span[k] 个整数 —— 各连通分量的大小。请按非降序输出这些整数。\n\n"},{"iden":"input","content":"第一行包含两个整数 #cf_span[n] 和 #cf_span[m] (#cf_span[1 ≤ n ≤ 200000], )。然后 #cf_span[m] 行，每行包含两个整数 #cf_span[x] 和 #cf_span[y] (#cf_span[1 ≤ x, y ≤ n], #cf_span[x ≠ y])，表示 #cf_span[x] 和 #cf_span[y] 之间 *没有边*。每对至多出现一次；(#cf_span[x, y]) 和 (#cf_span[y, x]) 被视为相同（因此在同一测试用例中不会同时出现）。如果某对顶点未在输入中列出，则这两顶点之间 *存在* 边。 "},{"iden":"output","content":"首先输出 #cf_span[k] —— 图中连通分量的数量。然后输出 #cf_span[k] 个整数 —— 各连通分量的大小。请按非降序输出这些整数。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ with $ 1 \\leq n \\leq 200000 $, $ m \\geq 0 $.  \nLet $ G = (V, E) $ be an undirected graph where $ V = \\{1, 2, \\dots, n\\} $, and $ E = \\binom{V}{2} \\setminus F $, where $ F \\subseteq \\binom{V}{2} $ is the set of $ m $ non-edges given as unordered pairs $ \\{x, y\\} $ with $ x \\ne y $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 200000 $  \n2. $ 0 \\leq m \\leq \\binom{n}{2} $  \n3. Each pair $ \\{x, y\\} \\in F $ satisfies $ 1 \\leq x, y \\leq n $, $ x \\ne y $, and no duplicate pairs.  \n4. $ F $ contains no ordered pairs; $ \\{x, y\\} = \\{y, x\\} $.\n\n**Objective**  \nCompute the connected components of $ G $. Let $ \\mathcal{C} = \\{C_1, C_2, \\dots, C_k\\} $ be the set of connected components, where each $ C_i \\subseteq V $ is maximal under connectivity in $ G $.  \nOutput:  \n- $ k = |\\mathcal{C}| $, the number of connected components.  \n- The sizes $ |C_1|, |C_2|, \\dots, |C_k| $, sorted in non-decreasing order.","simple_statement":null,"has_page_source":false}