#include <bits/stdc++.h>
using namespace std;
 
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    if(!(cin >> n >> m)) return 0;
    vector<pair<int,int>> edges(m);
    vector<vector<int>> adj(n+1);
    vector<int> deg(n+1,0);
    for(int i=0;i<m;i++){
        int u,v; cin >> u >> v;
        edges[i] = {u,v};
        adj[u].push_back(v);
        adj[v].push_back(u);
        deg[u]++; deg[v]++;
    }
 
    // Build linear system for t[1..n-1] (exclude n). We'll index rows for vertices 1..n-1.
    int N = n-1; // number of unknowns (if n==1 impossible by constraints)
    vector<vector<double>> A(N, vector<double>(N+1, 0.0)); // augmented matrix
 
    auto idx = [&](int v)->int{ // map vertex v (1..n-1) to row index 0..N-1
        return v-1;
    };
 
    for(int v=1; v<=n-1; ++v){
        int r = idx(v);
        A[r][r] = 1.0;
        // subtract contributions: for each u (neighbour) with u != n, coefficient of t[u] is -P(u->v) = -1/deg(u) if edge(u,v)
        for(int u=1; u<=n; ++u){
            // we need term for neighbors u that have edge u-v; faster to iterate adjacency of v
            // but we need P(u->v) so iterate neighbors u of v? we will instead loop adj[v]
        }
    }
    // Fill properly by iterating u for each neighbor relation:
    for(int u=1; u<=n; ++u){
        for(int v_nei : adj[u]){
            // there is edge u -> v_nei, add -1/deg(u) to equation for v_nei (if v_nei != n)
            if(v_nei == n) continue;
            if(u == n) continue; // if u==n, P(n->*) doesn't matter because we never depart from n (absorbing)
            int row = idx(v_nei);
            int col = idx(u);
            A[row][col] -= 1.0 / deg[u];
        }
    }
    // RHS b: b[v] = 1 if v==1 else 0
    for(int v=1; v<=n-1; ++v){
        int r = idx(v);
        A[r][N] = (v==1) ? 1.0 : 0.0;
    }
 
    // Solve A * t = b by Gaussian elimination (partial pivot)
    for(int col=0, row=0; col<N && row<N; ++col, ++row){
        // find pivot
        int piv = row;
        for(int i=row;i<N;++i){
            if(fabs(A[i][col]) > fabs(A[piv][col])) piv = i;
        }
        if(fabs(A[piv][col]) < 1e-15){
            // column is (nearly) zero, skip (shouldn't happen in connected graph)
            --row;
            continue;
        }
        if(piv != row) swap(A[piv], A[row]);
        // normalize and eliminate
        double pivot = A[row][col];
        for(int j=col;j<=N;j++) A[row][j] /= pivot;
        for(int i=0;i<N;++i){
            if(i==row) continue;
            double factor = A[i][col];
            if(fabs(factor) < 1e-18) continue;
            for(int j=col;j<=N;j++){
                A[i][j] -= factor * A[row][j];
            }
        }
    }
 
    vector<double> t(n+1, 0.0);
    for(int v=1; v<=n-1; ++v){
        int r = idx(v);
        t[v] = A[r][N];
    }
    t[n] = 0.0;
 
    // compute w_e for each edge
    vector<double> w(m);
    for(int i=0;i<m;i++){
        int u = edges[i].first;
        int v = edges[i].second;
        double wu = (deg[u] > 0) ? t[u] / deg[u] : 0.0;
        double wv = (deg[v] > 0) ? t[v] / deg[v] : 0.0;
        w[i] = wu + wv;
    }
 
    // sort descending
    sort(w.begin(), w.end(), greater<double>());
 
    // compute answer = sum_{i=1..m} i * w[i-1]
    long double ans = 0.0L;
    for(int i=0;i<m;i++){
        ans += (long double)(i+1) * (long double)w[i];
    }
 
    cout.setf(std::ios::fixed); cout<<setprecision(3)<<(double)ans<<"\n";
    return 0;
}