#include<bits/stdc++.h>
using namespace std;
#define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long int ll;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::vector<ll> vll;
typedef std::vector<vi > vvi;
typedef std::vector<vll > vvll;
typedef std::pair<int,int> ii;
typedef std::pair< ll, ll > lp;
typedef std::vector<lp> vii;
typedef std::vector<vii > vvii;
#define pb push_back
#define PB pop_back
#define pf push_front
#define PF pop_front
#define mp make_pair
#define mem(a,b) memset(a,b,sizeof(a))
#define in(a,n) F(i,0,n-1)cin>>a[i]
#define in1(a,n) F(i,1,n)cin>>a[i]
#define ff first
#define ss second
#define F(i,a,b) for (ll i=a;i<=b;i++)
#define RF(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,n) F(i,0,n-1)
#define clr(a) (a).clear()
#define rz resize
#define sqr(a) ((a) * (a))
#define sz(a) int((a).size())
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(),
vi g[500005];
int vis[500005];
int dis[500005];
int low[500005];
vii bridge;
int tim;
void dfs(int v,int vp)
{
vis[v]=1;
dis[v]=low[v]=tim++;
for (int u : g[v])
{
if (u==vp)continue;
if (vis[u])
low[v]=min(low[v],dis[u]);
else
{
dfs(u,v);
low[v]=min(low[v],low[u]);
if (low[u] > dis[v])
bridge.pb({u,v});
}
}
}
int main(int argc, char const *argv[])
{
crap;
int n,m,u,v;
cin>>n>>m;
rep(i,m)
{
cin>>u>>v;
g[u].pb(v);
g[v].pb(u);
}
//time=0;
dfs(1,0);
set<int> idk;
for (auto i : bridge)
{
idk.insert(min(i.ff,i.ss));
}
ll x=ll(sz(idk));
ll num=x*(n-1);
num-=(x*(x-1))/2;
ll den=(ll(n))*(n-1);
den/=2;
double final=(1.0*num)/den;
cout<<fixed<<setprecision(5)<<final<<"\n";
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBjcmFwI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