#include <bits/stdc++.h>
using namespace std;
const long long N = 400 + 5;
vector<int> a[N], S, Q;
double p[N], d[N], ans, temp;
bool in[N];
int f[N][N];
int n, m, x, y, z;
double out() {
  for (int i = 0; i < S.size(); i++)
    for (int j = 0; j < a[S[i]].size(); j++) {
      int x = a[S[i]][j];
      p[x] += 1. / n / a[S[i]].size();
      if (!in[x]) in[x] = 1, Q.push_back(x);
    }
  double ans = 0, temp;
  for (int i = 1; i <= n; i++) {
    temp = 0;
    for (int j = 0; j < Q.size(); j++)
      d[f[Q[j]][i]] = max(d[f[Q[j]][i]], p[Q[j]]);
    for (int j = 0; j < Q.size(); j++) {
      temp += d[f[Q[j]][i]];
      d[f[Q[j]][i]] = 0;
    }
    ans = max(ans, temp);
  }
  for (int i = 0; i < Q.size(); i++) in[Q[i]] = 0, p[Q[i]] = 0;
  Q.clear();
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) f[i][j] = 1e9;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
    f[x][y] = f[y][x] = 1;
  }
  for (int k = 1; k <= n; k++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (f[i][j] > f[i][k] + f[k][j]) f[i][j] = f[i][k] + f[k][j];
  for (int i = 1; i <= n; i++) {
    temp = 0;
    for (int j = 0; j <= n; j++) {
      S.clear();
      for (int k = 1; k <= n; k++)
        if (f[i][k] == j) S.push_back(k);
      if (S.empty()) continue;
      temp += max(1. / n, out());
    }
    ans = max(ans, temp);
  }
  printf("%.12lf", ans);
}
