#P10942. GF和猫咪的玩具
GF和猫咪的玩具
Problem Description
Student GF and a cat got a special toy. The toy consists of metal rings (numbered ) and ropes. Each rope connects two different metal rings, and all ropes have the same length. GF picks up ring with his left hand, and the cat picks up ring with its right hand (or paw). Then they pull as hard as possible in opposite directions. GF wants to choose suitable and so that the number of ropes that become taut is as large as possible.
Note: If, as in the sample, forms a cycle, we consider that when pulling and , only one side can be made taut ( or ), and it does not count as making all of them taut. In plain words, when there are multiple connection ways between two rings with the same number of ropes, only one of these ways is counted as being made taut, not all of them.
Input Format
The first line contains two positive integers ().
The next lines each contain two positive integers , meaning there is a rope connecting and .
Output Format
Only one integer, representing the maximum number of ropes that can be made taut.
6 6
1 2
1 6
2 4
6 5
4 3
5 3
3
Hint
Translated by ChatGPT 5