#include <bits/stdc++.h>
using namespace std;
const int MOD(1000000007);
const int INF((1 << 30) - 1);
const int MAXN(405);
vector<int> a[MAXN];
int d[MAXN][MAXN], c[MAXN];
double p[MAXN], pmax[MAXN];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (i == j)
        d[i][j] = 0;
      else
        d[i][j] = INF;
    }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    a[u].push_back(v);
    a[v].push_back(u);
    d[u][v] = d[v][u] = 1;
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  double ans = 0.0;
  for (int i = 1; i <= n; i++) {
    double t1 = 0.0, t2, t3;
    for (int dist = 0; dist <= n - 1; dist++) {
      vector<int> b;
      for (int j = 1; j <= n; j++) {
        c[j] = 0;
        p[j] = 0.0;
      }
      for (int j = 1; j <= n; j++) {
        if (d[i][j] == dist) {
          for (int k = 0; k < a[j].size(); k++) {
            int u = a[j][k];
            p[u] += 1.0 / n / a[j].size();
            if (!c[u]) {
              b.push_back(u);
              c[u] = 1;
            }
          }
        }
      }
      if (b.size() == 0) continue;
      t2 = 0.0;
      for (int k = 1; k <= n; k++) {
        for (int j = 0; j < b.size(); j++) {
          int u = b[j];
          pmax[d[k][u]] = max(pmax[d[k][u]], p[u]);
        }
        t3 = 0.0;
        for (int j = 0; j < b.size(); j++) {
          int u = b[j];
          t3 += pmax[d[k][u]];
          pmax[d[k][u]] = 0.0;
        }
        t2 = max(t2, t3);
      }
      t1 += max(1.0 / n, t2);
    }
    ans = max(ans, t1);
  }
  printf("%.10lf", ans);
}
