#include <bits/stdc++.h>
using namespace std;
const int MaxN = 405, inf = 0x3f3f3f3f;
struct Graph {
  int n;
  vector<vector<int>> edges, dist;
  inline Graph(int _n) : n(_n) {
    edges.assign(n + 1, vector<int>());
    dist.assign(n + 1, vector<int>(n + 1, inf));
    for (int i = 0; i <= n; ++i) dist[i][i] = 0;
  }
  inline void AddEdge(int x, int y) {
    edges[x].emplace_back(y);
    edges[y].emplace_back(x);
    dist[x][y] = dist[y][x] = 1;
  }
  inline void Floyd() {
    for (int k = 1; k <= n; ++k)
      for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
          dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
  }
  inline double Compute(int start, int dis) {
    vector<int> nodes;
    vector<double> prob(n + 1, 0), max_prob(n + 1, 0);
    vector<bool> vis(n + 1, false);
    for (int i = 1; i <= n; ++i) {
      if (dist[start][i] == dis) {
        for (int nxt : edges[i]) {
          if (!vis[nxt]) {
            nodes.emplace_back(nxt);
            vis[nxt] = true;
          }
          prob[nxt] += 1.0 / n / edges[i].size();
        }
      }
    }
    double max_sum = 0;
    for (int j = 1; j <= n; ++j) {
      double res = 0;
      for (int nxt : nodes) {
        int d = dist[j][nxt];
        max_prob[d] = max(prob[nxt], max_prob[d]);
      }
      for (int nxt : nodes) {
        int d = dist[j][nxt];
        res += max_prob[d];
        max_prob[d] = 0;
      }
      max_sum = max(max_sum, res);
    }
    return max_sum;
  }
  inline double Solve() {
    double answer = 0;
    for (int i = 1; i <= n; ++i) {
      double cur = 0;
      for (int d1 = 0; d1 <= n; ++d1) {
        int cnt = 0;
        for (int j = 1; j <= n; ++j)
          if (dist[i][j] == d1) ++cnt;
        if (cnt == 0) continue;
        double prob = 1 / (1.0 * n);
        cur += max(prob, Compute(i, d1));
      }
      answer = max(answer, cur);
    }
    return answer;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  Graph G(n);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    G.AddEdge(x, y);
  }
  G.Floyd();
  cout << setprecision(10) << fixed << G.Solve() << endl;
  return 0;
}
