#include <bits/stdc++.h>
template <class T>
inline void chkmax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class T>
inline void chkmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <class T>
inline void read(T &x) {
  char c;
  int f = 1;
  x = 0;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    f = -1;
  else
    x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = x * 10 + c - '0';
  x *= f;
}
template <class T>
inline void write(T x) {
  static int outn;
  static char out[(int)2e7];
  if (x < 0) out[outn++] = '-', x = -x;
  if (x) {
    static int tmpn;
    static char tmp[20];
    tmpn = 0;
    while (x) tmp[tmpn++] = x % 10 + '0', x /= 10;
    while (tmpn) out[outn++] = tmp[--tmpn];
  } else
    out[outn++] = '0';
}
const int N = 400;
const int INF = 1e9;
int n, m;
int deg[N + 9];
bool adj[N + 9][N + 9];
int g[N + 9][N + 9];
std::pair<int, int> p[N + 9];
int a[N + 9], an;
int b[N + 9], bn;
int vis[N + 9], visc;
double f[N + 9];
double h[N + 9];
int q[N + 9], qn;
double ans;
inline double work(std::pair<int, int> *p, int pn) {
  ++visc, an = pn, bn = 0;
  for (int i = 1; i <= an; ++i) a[i] = p[i].second;
  std::fill(f + 1, f + n + 1, 0);
  for (int i = 1; i <= an; ++i)
    for (int j = 1; j <= n; ++j)
      if (adj[a[i]][j]) {
        f[j] += 1.0 / (an * deg[a[i]]);
        if (vis[j] != visc) vis[j] = visc, b[++bn] = j;
      }
  double ret = 0;
  for (int i = 1; i <= n; ++i) {
    double cur = 0;
    std::fill(h, h + n, 0);
    ++visc, qn = 0;
    for (int j = 1; j <= bn; ++j)
      if (g[i][b[j]] < INF) {
        chkmax(h[g[i][b[j]]], f[b[j]]);
        if (vis[g[i][b[j]]] != visc) {
          q[++qn] = g[i][b[j]];
          vis[g[i][b[j]]] = visc;
        }
      }
    for (int j = 1; j <= qn; ++j) cur += h[q[j]];
    chkmax(ret, cur);
  }
  return ret;
}
int main() {
  read(n), read(m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j)
        g[i][j] = INF;
      else
        g[i][j] = 0;
  while (m--) {
    int u, v;
    read(u), read(v);
    deg[u]++, deg[v]++;
    adj[u][v] = adj[v][u] = true, g[u][v] = g[v][u] = 1;
  }
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j) chkmin(g[i][j], g[i][k] + g[k][j]);
  for (int i = 1; i <= n; ++i) {
    double cur = 0;
    for (int j = 1; j <= n; ++j) p[j] = std::make_pair(g[i][j], j);
    std::sort(p + 1, p + n + 1);
    for (int j = 1; j <= n; ++j) {
      int k = j;
      while (k < n && p[k + 1].first == p[j].first) ++k;
      cur += std::max((double)(k - j + 1) / n * work(p + j - 1, k - j + 1),
                      1.0 / n);
      j = k;
    }
    chkmax(ans, cur);
  }
  printf("%.10lf\n", ans);
  return 0;
}
