#include <bits/stdc++.h>
using namespace std;
const int maxn = 404;
int n, m;
vector<int> g[maxn];
vector<int> q, G;
int dis[maxn][maxn];
long double p[maxn], P;
pair<long double, int> mxp[maxn];
long double ans;
void bfs(int s) {
  dis[s][s] = 0;
  q.resize(0);
  q.push_back(s);
  for (int v, i = 0; i < q.size(); i++) {
    v = q[i];
    for (int u : g[v])
      if (dis[s][v] + 1 < dis[s][u]) {
        dis[s][u] = dis[s][v] + 1;
        q.push_back(u);
      }
  }
}
long double f(int v) {
  long double ret = 0;
  for (int d = 0; d < n; d++) {
    G.resize(0);
    for (int i = 0; i < n; i++) p[i] = 0;
    for (int i = 0; i < n; i++)
      if (dis[v][i] == d) {
        for (int j : g[i]) {
          if (p[j] == 0) G.push_back(j);
          p[j] += P / g[i].size();
        }
      }
    if (!G.size()) break;
    for (int i = 0; i < n; i++) mxp[i] = {0, -1};
    long double X = P, x;
    for (int u = 0; u < n; u++) {
      x = 0;
      for (int c : G) {
        if (mxp[dis[u][c]].second == u) x -= mxp[dis[u][c]].first;
        if (mxp[dis[u][c]].second != u or mxp[dis[u][c]].first < p[c])
          mxp[dis[u][c]] = {p[c], u};
        if (mxp[dis[u][c]].second == u) x += mxp[dis[u][c]].first;
      }
      X = max(X, x);
    }
    ret += X;
  }
  return ret;
}
int main() {
  memset(dis, 127, sizeof dis);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int v, u, i = 0; i < m; i++) {
    cin >> v >> u;
    v--, u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  for (int i = 0; i < n; i++) bfs(i);
  P = 1.0 / n;
  for (int i = 0; i < n; i++) {
    ans = max(ans, f(i));
  }
  cout << setprecision(15) << fixed << ans << endl;
  return 0;
}
