#P9394. 白鹭兰
白鹭兰
Problem Description
There are many legends about Martians, such as their DNA being very complex, or that they have tens of thousands of fingers, and so on, but none of these have been confirmed. Another unconfirmed legend is that Martians are very good at solving OI problems.
To verify this last legend, people on Earth gave an OI problem to an alien traveler from Mars:
Given a connected undirected graph with vertices and edges, find the minimum such that there exists a partition of the vertex set satisfying:
, the induced subgraph of is connected;
, the induced subgraph of is connected;
, .
Note that, as a partition, it must also satisfy , , and all are non-empty.
Output the minimum and a corresponding partition.
Goodbye, You're Martian. Now you need to finish this problem and prove the wisdom of Martians.
Input Format
The first line: two integers , representing the number of vertices and edges of graph .
The next lines: each line contains two integers , representing an undirected edge connecting vertices .
Output Format
The first line: two integers , representing the minimum and the size of the corresponding partition.
The next lines: on the -th line, first an integer , representing the size of , followed by integers representing the elements of .
If there are multiple valid partitions, you may output any one of them. Note that you do not need to minimize .
7 7
1 2
1 3
1 5
1 6
4 5
5 6
6 7
2 5
1 2
2 1 3
2 5 4
1 6
1 7
Hint
[Sample Explanation]
In the figure below, are the red / orange / green / blue / purple vertex sets, respectively. You can verify that they satisfy the conditions.

[Scoring]
If your output format is incorrect, you may get no points, and it may also cause unpredictable errors.
If your output format is correct, then if your is correct, you will get of the score for the test point. If, on this basis, your construction is also correct, you will get of the score for the test point.
[Constraints]
For all data: , , . It is guaranteed that among the given edges there are no multiple edges and no self-loops, and the given graph is connected.
| Subtask ID | Special Constraints | Score | |
|---|---|---|---|
| is a path | |||
| None | |||
| is a tree | |||
| None | |||
| is a tree | |||
| None |

Translated by ChatGPT 5