You are given a simple undirected graph with vertices and edges.
For a non-empty set of vertices , define its score as:
where is the number of edges with both endpoints inside .
Let be the maximum possible score over all non-empty sets of vertices.
You do not need to find an optimal set. You only need to output any non-empty set of vertices whose score is at least half of .
In other words, if your chosen set is , your output is accepted if:
The input is given in the following format:
For each test case, output a non-empty set of vertices.
First, output an integer , the number of chosen vertices.
Then output distinct integers , the chosen vertices.
The output format is:
The chosen set is . It contains internal edges, so its score is .
The set has internal edges and score . Therefore the shown output is not optimal, but it is still good enough because is at least half of .