#include <bits/stdc++.h>
using namespace std;
const int MaxN = 4e2 + 10;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int n, m;
int ds[MaxN][MaxN], mark[MaxN], color;
vector<int> who[MaxN][MaxN];
vector<int> graph[MaxN];
double dd[MaxN], f[MaxN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i != j) {
        ds[i][j] = INF;
      }
    }
  }
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    graph[x].push_back(y);
    graph[y].push_back(x);
    ds[x][y] = ds[y][x] = 1;
  }
  for (int k = 1; k <= n; ++k) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        ds[i][j] = min(ds[i][j], ds[i][k] + ds[k][j]);
      }
    }
  }
  for (int v = 1; v <= n; ++v) {
    for (int u = 1; u <= n; ++u) {
      who[v][ds[v][u]].push_back(u);
    }
  }
  double ans = 0;
  for (int x = 1; x <= n; ++x) {
    double prob = 0;
    for (int d = 0; d < n; ++d) {
      if (who[x][d].size() == 0) {
        continue;
      }
      ++color;
      vector<int> poss;
      for (int i = 1; i <= n; ++i) {
        dd[i] = 0;
      }
      for (auto v : who[x][d]) {
        for (auto to : graph[v]) {
          dd[to] += 1.0 / n / graph[v].size();
          if (mark[to] != color) {
            poss.push_back(to);
            mark[to] = color;
          }
        }
      }
      double mx = 0;
      for (int y = 1; y <= n; ++y) {
        for (auto x : poss) {
          f[ds[y][x]] = max(f[ds[y][x]], dd[x]);
        }
        double cur = 0;
        for (auto x : poss) {
          cur += f[ds[y][x]];
          f[ds[y][x]] = 0;
        }
        mx = max(mx, cur);
      }
      prob += max(1.0 / n, mx);
    }
    ans = max(ans, prob);
  }
  printf("%.9f\n", (float)ans);
  return 0;
}
