#include <bits/stdc++.h>
using namespace std;
list<int> V[410];
list<int> L[410][410];
int n, m;
int D[410][410];
double P[410];
double Pc[410];
bool Intrest[410];
double MaxDup[410];
int main() {
  scanf("%d%d", &n, &m);
  int a, b;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    V[a].push_back(b);
    V[b].push_back(a);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) D[i][j] = -1;
    D[i][i] = 0;
    queue<int> Q;
    Q.push(i);
    while (!Q.empty()) {
      int c = Q.front();
      Q.pop();
      for (auto it = V[c].begin(); it != V[c].end(); ++it)
        if (D[i][*it] == -1) {
          D[i][*it] = D[i][c] + 1;
          Q.push(*it);
        }
    }
    for (int j = 1; j <= n; ++j) L[i][D[i][j]].push_back(j);
  }
  double maxprawd = 0;
  for (int i = 1; i <= n; ++i) {
    double Prawd = 0.0;
    for (int j = 0; j < n; ++j) {
      int nodleg = L[i][j].size();
      if (nodleg == 1) Prawd += 1.0 / n;
      if (nodleg > 1) {
        for (int i = 1; i <= n; ++i) {
          P[i] = 0;
          Intrest[i] = false;
        }
        vector<int> Fine;
        for (auto it = L[i][j].begin(); it != L[i][j].end(); ++it)
          for (auto it2 = V[*it].begin(); it2 != V[*it].end(); ++it2) {
            P[*it2] += (1.0 / n) * (1.0 / V[*it].size());
            if (Intrest[*it2] == false) {
              Intrest[*it2] = true;
              Fine.push_back(*it2);
            }
          }
        double maxtotal = 0.0;
        double total = 0.0;
        double maxtmp = 0.0;
        for (int i = 1; i <= n; ++i) {
          total = 0;
          for (int j = 0; j < Fine.size(); ++j)
            MaxDup[D[i][Fine[j]]] = max(MaxDup[D[i][Fine[j]]], P[Fine[j]]);
          for (int j = 0; j < Fine.size(); ++j) {
            total += MaxDup[D[i][Fine[j]]];
            MaxDup[D[i][Fine[j]]] = 0;
          }
          maxtotal = max(maxtotal, total);
        }
        maxtotal = max(maxtotal, 1.0 / n);
        Prawd += maxtotal;
      }
    }
    maxprawd = max(maxprawd, Prawd);
  }
  printf("%.13lf\n", maxprawd);
  return 0;
}
