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