#P3535. [POI 2012] TOU-Tour de Byteotia
[POI 2012] TOU-Tour de Byteotia
Description
Translated from POI 2012 Stage 2. Day 0 「Tour de Byteotia」.
Given an undirected graph with vertices and edges, find the minimum number of edges to delete so that all vertices with indices less than or equal to are not on any simple cycle.
Input Format
The first line contains three integers , , and , denoting vertices, edges, and as defined above.
Then follow lines, each containing two integers and , representing an undirected edge between and . It is guaranteed that there are no multiple edges.
Output Format
The first line contains an integer , the minimum number of edges to delete.
Then output lines, each containing two positive integers and , indicating that the edge between and is deleted. Output the smaller vertex first, then the larger one.
11 13 5
1 2
1 3
1 5
3 5
2 8
4 11
7 11
6 10
6 9
2 3
8 9
5 9
9 10
3
2 3
5 9
3 5
Hint
The sample illustration is as follows.

For of the testdata, , .
For of the testdata, , , , .
Translated from LibreOJ.
Translated by ChatGPT 5
京公网安备 11011102002149号