Party

题意翻译

题目描述: Arseny喜欢组织派对并邀请他的朋友们参加。然而,不仅朋友来参加他的聚会,还有他朋友的朋友,他朋友的朋友的朋友等等。所以Arseny的有一部分客人可能不了解他。他决定使用以下程序解决此问题。 在每一步,他都选择了一位客人A,成对地向A介绍了他的所有朋友。在完成这一步之后,他的任意两个朋友也会互相成为朋友。一直重复这个步骤到所有客人都互相为朋友为止。 Arseny不想花太多时间去完成这件事,所以他想用最少的步骤完成这个过程。Arseny需要你来帮帮她做到这一点。 输入输出格式 输入格式: 第一行包含两个整数n和m。n为派对上的客人人数(包括Arseny),m为Arseny朋友的人数。 接下来m行,每行包含两个整数u你和v,代表u和v在派对前就已经是朋友。保证每对朋友只会出现一次,并且友谊图表是相互关联的。 输出格式: 在第一行输出所有的客人都成为朋友所需的最少步骤数。 在第二行输出每个步骤中选择的客人编号。 如果有多个解决方案,您可以输出任意一个解决方案。 输入输出样例 输入样例#1: 5 6 1 2 1 3 2 3 2 5 3 4 4 5 输出样例#1: 2 2 3 输入样例#2: 4 4 1 2 1 3 1 4 3 4 输出样例#2: 1 1 说明: 1<=n<=22, 0<=m<=n*(n-1)/2. 1<=u; v<=n; u≠v. 在第一个样例中,没有客人是所有其他客人的朋友,因此至少需要执行两个步骤。第二位客人成对介绍他的所有朋友,只有一对客人(4,1)和(4,2)不是朋友。客人3或5可以介绍它们。 在第二个样例中,编号为1的客人是所有客人的朋友,所以他可以一步一步地介绍所有客人。 (大致题意:给你一堆一对对的关系,然后每一个关系对代表两个人认识。然后你每次可以选择一个人i,让i认识的所有人都相互认识,即i把介绍自己所有的朋友给其他人。然后现在问你最少需要选择多少个这样的i,使得所有的人都相互认识。)

题目描述

Arseny likes to organize parties and invite people to it. However, not only friends come to his parties, but friends of his friends, friends of friends of his friends and so on. That's why some of Arseny's guests can be unknown to him. He decided to fix this issue using the following procedure. At each step he selects one of his guests $ A $ , who pairwise introduces all of his friends to each other. After this action any two friends of $ A $ become friends. This process is run until all pairs of guests are friends. Arseny doesn't want to spend much time doing it, so he wants to finish this process using the minimum number of steps. Help Arseny to do it.

输入输出格式

输入格式


The first line contains two integers $ n $ and $ m $ ( $ 1<=n<=22 $ ; ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF906C/311dfc9367ec4774f6a0336927e0070aebdbe68d.png)) — the number of guests at the party (including Arseny) and the number of pairs of people which are friends. Each of the next $ m $ lines contains two integers $ u $ and $ v $ ( $ 1<=u,v<=n $ ; $ u≠v $ ), which means that people with numbers $ u $ and $ v $ are friends initially. It's guaranteed that each pair of friends is described not more than once and the graph of friendship is connected.

输出格式


In the first line print the minimum number of steps required to make all pairs of guests friends. In the second line print the ids of guests, who are selected at each step. If there are multiple solutions, you can output any of them.

输入输出样例

输入样例 #1

5 6
1 2
1 3
2 3
2 5
3 4
4 5

输出样例 #1

2
2 3 

输入样例 #2

4 4
1 2
1 3
1 4
3 4

输出样例 #2

1
1 

说明

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.