#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(401);
vector<vector<vector<int> > > distanceList(401);
int d[401][401], n;
double p[401], s[401][401], dp[401];
bool visited[401];
int main() {
  int m, i, j, k, x, y, z, t, dist;
  double f, ansx, ans = 0;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) d[i][j] = 401;
  for (i = 1; i <= n; i++) d[i][i] = 0;
  while (m--) {
    scanf("%d%d", &i, &j);
    d[i][j] = d[j][i] = 1;
  }
  for (k = 1; k <= n; k++)
    for (i = 1; i <= n; i++)
      for (j = 1; j <= n; j++) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
  for (i = 1; i <= n; i++) {
    ansx = 0;
    for (dist = 1; dist <= n; dist++) {
      vector<int> todayList;
      for (j = 1; j <= n; j++)
        if (d[i][j] == dist) todayList.push_back(j);
      if (todayList.empty()) break;
      m = todayList.size();
      for (y = 0; y < todayList.size(); y++) {
        j = todayList[y];
        for (k = 1, z = 0; k <= n; k++) z += (d[j][k] == 1);
        f = 1.0 / (n * z);
        for (k = 1; k <= n; k++)
          if (d[j][k] == 1) {
            p[k] += f;
            visited[k] = 1;
          }
      }
      for (j = 1; j <= n; j++) {
        if (visited[j] == 0) continue;
        for (k = 1; k <= n; k++) {
          x = d[j][k];
          if (p[j] > s[k][x]) {
            dp[k] += (p[j] - s[k][x]);
            s[k][x] = p[j];
          }
        }
      }
      f = 1.0 / n;
      for (j = 1; j <= n; j++) f = max(f, dp[j]);
      ansx += f;
      for (j = 1; j <= n; j++) {
        dp[j] = 0;
        p[j] = 0;
      }
      for (j = 1; j <= n; j++) {
        if (visited[j] == 0) continue;
        for (k = 1; k <= n; k++) {
          x = d[j][k];
          s[k][x] = 0;
        }
        visited[j] = 0;
      }
    }
    ans = max(ansx, ans);
  }
  ans += (1.0 / n);
  printf("%.15lf\n", ans);
  return 0;
}
