CF906C Party

题目描述

Arseny 喜欢组织派对并邀请他的朋友们参加。然而,不仅朋友来参加他的聚会,还有他朋友的朋友,他朋友的朋友的朋友等等。所以 Arseny 的有一部分客人可能不了解他,他决定使用以下方法解决此问题。 在每一步,他都选择了一位客人 $A$,将 $A$ 的所有朋友全都两两互相介绍一遍。在完成这一步之后,$A$ 的任意两个朋友也会互相成为朋友。Arseny 一直重复这个步骤直到所有客人都互相成为朋友为止。 Arseny 不想花太多时间去完成这件事,所以他想用最少的步骤完成这个过程。Arseny 需要你来帮帮她做到这一点。

输入格式

第一行包含两个整数 $n$ 和 $m$。$n$ 为派对上的客人人数(包括 Arseny),$m$ 为这些客人中的朋友对数。 接下来 $m$ 行,每行包含两个整数 $u,v$,表示 $u$ 和 $v$ 在派对前就已经是一对朋友。保证每个 $(u,v)$ 不重复,并且整个友谊图是联通的。$(1\le u,v\le n,u\neq v)$ 保证 $1\le n\le 22, 0\le m\le\frac{n\cdot(n-1)}{2}$。

输出格式

第一行输出所有的客人都互相成为朋友所需的最少步骤数。 第二行输出每个步骤中选择的客人编号。 如果有多个解决方案,您可以输出任意一个解决方案。 翻译来自于 [xyz105](https://www.luogu.com.cn/user/223100)。

说明/提示

In the first test case there is no guest who is friend of all other guests, so at least two steps are required to perform the task. After second guest pairwise introduces all his friends, only pairs of guests $ (4,1) $ and $ (4,2) $ are not friends. Guest $ 3 $ or $ 5 $ can introduce them. In the second test case guest number $ 1 $ is a friend of all guests, so he can pairwise introduce all guests in one step.