#include <bits/stdc++.h>
using namespace std;
const int maxn = 400 + 10;
int lau[maxn][maxn], f[maxn][maxn], cnt[maxn], n, m, vis[maxn], sign;
double ans, pro[maxn], dpro[maxn][maxn], sum[maxn];
vector<int> g[maxn];
vector<int> h[maxn];
void update(int p, int len, double pr) {
  if (lau[p][len] != sign) {
    lau[p][len] = sign;
    dpro[p][len] = 0;
  }
  if (dpro[p][len] < pr) {
    sum[p] += pr - dpro[p][len];
    dpro[p][len] = pr;
  }
}
double solve(int p) {
  for (int i = 0; i < n; i++) {
    cnt[i] = 0;
    g[i].clear();
  }
  for (int i = 1; i <= n; i++) {
    cnt[f[p][i]]++;
    g[f[p][i]].push_back(i);
  }
  double res = 0;
  memset(dpro, 0, sizeof(dpro));
  memset(lau, 0, sizeof(lau));
  for (int i = 0; i < n; i++) {
    if (cnt[i] < 1) continue;
    double v = (double)cnt[i] / n;
    double maxi = 1;
    if (cnt[i] == 1) {
      res += (double)1 / n;
      continue;
    }
    memset(vis, 0, sizeof(vis));
    memset(pro, 0, sizeof(pro));
    memset(sum, 0, sizeof(sum));
    sign = i + 1;
    for (int j = 0; j < g[i].size(); j++) {
      int u = g[i][j], num = h[u].size();
      for (int k = 0; k < h[u].size(); k++) {
        int hm = h[u][k], dis = f[p][hm];
        if (vis[hm] != i) {
          vis[hm] = i;
          pro[hm] = 0;
        }
        pro[hm] += (double)1.0 / (double)(num);
      }
    }
    for (int j = 1; j <= n; j++)
      if (vis[j] == i)
        for (int k = 1; k <= n; k++) update(k, f[j][k], pro[j]);
    for (int i = 1; i <= n; i++) maxi = max(maxi, sum[i]);
    res += maxi / n * 1.0;
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  memset(f, 127 / 2, sizeof(f));
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    f[x][y] = f[y][x] = 1;
    h[x].push_back(y);
    h[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) f[i][i] = 0;
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (i != k && k != j && i != j)
          f[i][j] = min(f[i][j], f[i][k] + f[k][j]);
  for (int i = 1; i <= n; i++) ans = max(ans, solve(i));
  printf("%.9lf\n", ans);
  return 0;
}
