Bridge Minimization - MarisaOJ: Marisa Online Judge

Bridge Minimization

Time limit: 1000 ms
Memory limit: 256 MB
Given a simple, undirected graph with $n$ vertices and $m$ edges, determine the maximum number of bridges that can be reduced after adding an edge to the graph. ### Input - The first line contains 2 integers $n,m$. - The next $m$ lines, each line contains two integers $u, v$, there is an edge between $u$ and $v$. ### Output - Print the maximum number of bridges can be reduced. ### Constraints - $1 \le n,m \le 10^5$. - $1 \le u,v \le n$. ### Example Input: ``` 6 5 1 3 2 3 3 4 4 5 4 6 ``` Output: ``` 3 ```