Bridges
InterviewTime limit2sMemory limit1024 MB
Given a connected graph, find the fewest extra edges needed so that no edge is a bridge anymore.
Problem
King Julian rules over islands, numbered from 1 to . Some pairs of islands are connected by bridges that can be crossed in both directions. There are bridges in total. Any island can be reached from any other island by moving across the bridges.
A bridge is critical if, when it collapses, there exist two islands such that one cannot be reached from the other using the remaining bridges.
King Julian is worried about the safety and reliability of communication in his realm. He wants to build additional bridges between some pairs of islands so that no critical bridge remains. Since he is also thrifty, he wants to find the minimum number of additional bridges needed to meet this requirement.
Input
The first line contains two integers and , the number of islands and the number of bridges (, ). Each of the next lines contains two integers and , the islands connected by the -th bridge (, ).
It is guaranteed that any island can be reached from any other island by moving across the bridges.
Output
Print one integer: the minimum number of additional bridges that must be built so that no critical bridges remain.