#include <bits/stdc++.h>
using namespace std;
const int N = 440;
const double eps = 1e-9;
int i, j, k, l, n, m, ch, En, x, y;
int h[N], du[N], a[N][N], b[N][N], nn[N];
double ans, now, p[N], q[N];
struct cc {
  double p;
  int x;
} A[N];
struct edge {
  int s, n;
} E[N * N];
void R(int &x) {
  x = 0;
  ch = getchar();
  while (ch < '0' || '9' < ch) ch = getchar();
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
}
void E_add(int x, int y) {
  du[x]++;
  du[y]++;
  a[x][y] = a[y][x] = 1;
  E[++En].s = y;
  E[En].n = h[x];
  h[x] = En;
  E[++En].s = x;
  E[En].n = h[y];
  h[y] = En;
}
double max(double x, double y) {
  if (x > y) return x;
  return y;
}
double get_num(int x) {
  int i, j, k, nm = 0;
  for (i = 1; i <= n; i++) p[i] = 0.0;
  for (i = 1; i <= nn[x]; i++)
    for (k = h[b[x][i]]; k; k = E[k].n)
      p[E[k].s] += 1.0 / (1.0 * n * du[b[x][i]]);
  for (i = 1; i <= n; i++)
    if (p[i] > eps) {
      A[++nm].p = p[i];
      A[nm].x = i;
    }
  double ans = 0.0, now;
  for (i = 1; i <= n; i++) {
    now = 0.0;
    for (j = 1; j <= nm; j++) q[a[i][A[j].x]] = 0.0;
    for (j = 1; j <= nm; j++)
      if (A[j].p > q[a[i][A[j].x]]) {
        now += A[j].p - q[a[i][A[j].x]];
        q[a[i][A[j].x]] = A[j].p;
      }
    ans = max(ans, now);
  }
  return ans;
}
int main() {
  memset(a, 60, sizeof a);
  R(n);
  R(m);
  for (i = 1; i <= n; i++) a[i][i] = 0;
  for (i = 1; i <= m; i++) {
    R(x);
    R(y);
    E_add(x, y);
  }
  for (k = 1; k <= n; k++)
    for (i = 1; i <= n; i++)
      for (j = 1; j <= n; j++)
        if (a[i][k] + a[k][j] < a[i][j]) a[i][j] = a[i][k] + a[k][j];
  for (i = 1; i <= n; i++) {
    now = 0.0;
    for (j = 0; j < n; j++) nn[j] = 0;
    for (j = 1; j <= n; j++) {
      k = a[i][j];
      b[k][++nn[k]] = j;
    }
    for (j = 0; j < n; j++)
      if (nn[j]) {
        if (nn[j] == 1)
          now += 1.0 / (1.0 * n);
        else
          now += max(1.0 / (1.0 * n), get_num(j));
      }
    ans = max(ans, now);
  }
  printf("%.9lf\n", ans);
}
