#P1636. Einstein学画画
Einstein学画画
Description
Einstein has started learning to draw.
He is rather lazy, and he hopes to draw a picture using as few strokes as possible.
Given an undirected graph with vertices (numbered ) and edges, find the minimum number of strokes needed to draw all the edges in the graph.
Input Format
The first line contains two integers .
Each of the next lines contains two integers (), indicating that there is an edge between vertices and .
No edge is described more than once.
Output Format
A single integer, i.e., the answer.
5 5
2 3
2 4
2 5
3 4
4 5
1
Hint
For of the testdata, , .
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号