#include <bits/stdc++.h>
using namespace std;
double b[500], c[500];
int d[500][500], q[500];
int i, j, k, l, m, n, p, u, v, x, y;
double r, s, t, w;
int main() {
  scanf("%d%d", &n, &m);
  memset(d, 12, sizeof(d));
  for (i = 1; i <= n; i++) d[i][i] = 0;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    d[x][y] = d[y][x] = 1;
  }
  for (k = 1; k <= n; k++)
    for (i = 1; i <= n; i++)
      for (j = 1; j <= n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  for (i = 1; i <= n; i++) {
    r = 0;
    for (j = 0; j < n; j++) {
      t = 0;
      memset(b, 0, sizeof(b));
      for (k = 1, u = 0; k <= n; k++)
        if (d[i][k] == j) {
          u++;
          for (l = 1, v = 0; l <= n; l++)
            if (d[k][l] == 1) v++;
          for (l = 1; l <= n; l++)
            if (d[k][l] == 1) b[l] = b[l] + 1.0 / v;
        }
      p = 0;
      for (k = 1; k <= n; k++)
        if (abs(d[i][k] - j) <= 1) p++, q[p] = k;
      for (k = 1; k <= n; k++) {
        w = 0;
        for (l = 1; l <= p; l++)
          if (b[q[l]] > c[d[k][q[l]]])
            w = w - c[d[k][q[l]]], c[d[k][q[l]]] = b[q[l]],
            w = w + c[d[k][q[l]]];
        for (l = 1; l <= p; l++) c[d[k][q[l]]] = 0;
        t = max(t, w);
      }
      if (u) t = max(t, 1.0);
      r = r + t / n;
    }
    s = max(s, r);
  }
  printf("%.12lf", s);
  return 0;
}
