#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3fffffff;
const int MOD = 1000000007;
template <typename tn>
inline tn read() {
  char ch;
  tn f = 1;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  tn x = ch - '0';
  while (isdigit(ch = getchar())) x = x * 10 + ch - '0';
  return x * f;
}
template <typename tn>
inline void cmax(tn &a, tn b) {
  if (a < b) a = b;
}
template <typename tn>
inline void cmin(tn &a, tn b) {
  if (a > b) a = b;
}
const int N = 400 + 5;
vector<int> v[N], dot;
int a[N][N], d[N];
double s[N], w[N];
int main() {
  int n = read<int>(), m = read<int>();
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (n); j++)
      if (i != j) a[i][j] = inf;
  for (int i = (1); i <= (m); i++) {
    int x = read<int>(), y = read<int>();
    a[x][y] = a[y][x] = 1, d[x]++, d[y]++;
  }
  for (int k = (1); k <= (n); k++)
    for (int i = (1); i <= (n); i++)
      for (int j = (1); j <= (n); j++) cmin(a[i][j], a[i][k] + a[k][j]);
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (n); j++)
      if (a[i][j] > n) cout << "CAO" << endl;
  double ans = 0;
  for (int i = (1); i <= (n); i++) {
    double now = 0;
    for (int j = 0; j < (n); j++) v[j].clear();
    for (int j = (1); j <= (n); j++) v[a[i][j]].push_back(j);
    for (int dis = 0; dis < (n); dis++) {
      if (v[dis].size() <= 1) {
        now += (double)v[dis].size() / n;
        continue;
      }
      double cur = 1.0 / n;
      dot.clear(), memset(w, 0, sizeof(w));
      for (int j = 0; j < v[dis].size(); j++)
        for (int k = (1); k <= (n); k++)
          if (a[v[dis][j]][k] == 1) {
            if (abs(w[k]) < 1e-12) dot.push_back(k);
            w[k] += 1.0 / n / d[v[dis][j]];
          }
      for (int j = (1); j <= (n); j++) {
        double tmp = 0;
        for (int k = 0; k < dot.size(); k++) cmax(s[a[j][dot[k]]], w[dot[k]]);
        for (int k = 0; k < dot.size(); k++)
          tmp += s[a[j][dot[k]]], s[a[j][dot[k]]] = 0;
        cmax(cur, tmp);
      }
      now += cur;
    }
    cmax(ans, now);
  }
  cout << fixed << setprecision(16) << ans << endl;
}
