#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];
void bfsTraversal(int s) {
  int i, j, k;
  for (i = 0; i <= n; i++) d[s][i] = 401;
  d[s][s] = 0;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    i = q.front();
    q.pop();
    for (j = 0; j < adj[i].size(); j++) {
      k = adj[i][j];
      if (d[s][k] == 401) {
        d[s][k] = d[s][i] + 1;
        q.push(k);
      }
    }
  }
  for (i = 1, k = 0; i <= n; i++) k = max(k, d[s][i]);
  distanceList[s].resize(k + 1);
  for (i = 1; i <= n; i++) distanceList[s][d[s][i]].push_back(i);
}
int main() {
  int m, i, j, k, x, y, z, t;
  double f, ansx, ans = 0;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &i, &j);
    adj[i].push_back(j);
    adj[j].push_back(i);
  }
  for (i = 1; i <= n; i++) bfsTraversal(i);
  for (i = 1; i <= n; i++) {
    ansx = 0;
    for (x = 1; x < distanceList[i].size(); x++) {
      for (y = 0; y < distanceList[i][x].size(); y++) {
        j = distanceList[i][x][y];
        f = 1.0 / n;
        f /= adj[j].size();
        for (z = 0; z < adj[j].size(); z++) {
          k = adj[j][z];
          p[k] += f;
          visited[k] = 1;
        }
      }
      for (j = 1; j <= n; j++) {
        if (visited[j] == 0) continue;
        for (k = 1; k <= n; k++) {
          z = d[j][k];
          if (p[j] > s[k][z]) {
            dp[k] += (p[j] - s[k][z]);
            s[k][z] = 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++) {
        if (visited[j] == 0) continue;
        p[j] = 0;
        for (k = 1; k <= n; k++) {
          z = d[j][k];
          s[k][z] = 0;
        }
        visited[j] = 0;
      }
      for (j = 1; j <= n; j++) dp[j] = 0;
    }
    ans = max(ans, ansx);
  }
  ans += (1.0 / n);
  printf("%.15lf\n", ans);
  return 0;
}
