#graph203. Redundant Paths

Redundant Paths

Redundant Paths

题目来源

USACO 2006 Jan

题目描述

给一个nn个点mm条边的无向连通图,问最少添加多少条边使得成为一个边双连通图。

输入格式

第一行包含两个数n,m(1≤n≤5000,1≤m≤104)n, m(1\leq n\leq 5000, 1\leq m\leq 10^4)。

接下来mm行,每行两个整数u,vu, v表示一条无向边。

输出格式

一个整数,表示答案。

样例输入

7 7
1 2
2 3
3 4
2 5
4 5
5 6
5 7

样例输出

2