#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, a[405][405], o[405], U[405], tt, TT, d[405], D[405];
double mx, now, ans, tmp, e[405], g[405];
vector<int> b[405];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j) a[i][j] = 1000000;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    a[x][y] = a[y][x] = 1;
    ++U[x];
    ++U[y];
  }
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j) a[i][j] = min(a[i][k] + a[k][j], a[i][j]);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) b[a[i][j]].push_back(j);
    now = 0;
    for (int j = 0; j < n; ++j) {
      if (b[j].size() == 0) continue;
      for (int k = 0; k < b[j].size(); ++k)
        for (int p = 1; p <= n; ++p)
          if (a[b[j][k]][p] == 1) e[p] += 1.0 / U[b[j][k]];
      for (int p = 1; p <= n; ++p)
        if (e[p] > 0.000000001) d[++tt] = p;
      mx = 1;
      for (int t = 1; t <= n; ++t) {
        tmp = 0;
        for (int p = 1; p <= tt; ++p) {
          if (g[a[t][d[p]]] < 0.000000001) D[++TT] = a[t][d[p]];
          g[a[t][d[p]]] = max(g[a[t][d[p]]], e[d[p]]);
        }
        for (int p = 1; p <= TT; ++p) {
          tmp += g[D[p]];
          g[D[p]] = 0;
        }
        TT = 0;
        mx = max(mx, tmp);
      }
      now += mx;
      tt = 0;
      for (int p = 1; p <= n; ++p) e[p] = 0;
      b[j].clear();
    }
    ans = max(ans, now);
  }
  printf("%.15lf\n", ans / n);
  return 0;
}
