#C5066. Maximum Clique in a Social Network

    ID: 48674 Type: Default 1000ms 256MiB

Maximum Clique in a Social Network

Maximum Clique in a Social Network

In this problem, you are given an undirected graph representing a social network with \(n\) individuals and \(m\) friendship relations. Each friendship relation is represented by an edge between two individuals. A clique is a subset of vertices such that every two distinct vertices in the subset are directly connected by an edge. Your task is to find a maximum clique --- that is, a clique with the largest number of vertices. If there are multiple answers, you may output any one of them.

Definition: A set \(S\) of vertices is a clique if for every two vertices \(i, j \in S\) with \(i \neq j\), there is an edge between \(i\) and \(j\). The size of the clique is \(|S|\).

Note: It is guaranteed that \(n\) is small enough to allow a brute-force solution.

inputFormat

The input is given via standard input (stdin) and consists of multiple lines. The first line contains two integers \(n\) and \(m\) which represent the number of individuals and the number of friendship relations, respectively. The following \(m\) lines each contain two integers \(u\) and \(v\), indicating that person \(u\) and person \(v\) are friends. All individuals are numbered from 1 to \(n\).

outputFormat

Output to standard output (stdout) two lines. The first line should contain a single integer, representing the size of the largest clique. The second line should contain the list of members in the clique sorted in increasing order, with each number separated by a space.

## sample
5 6
1 2
1 3
1 4
2 3
2 4
3 4
4

1 2 3 4

</p>