#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int IT_MAX = 4096;
const long long MOD = 1000000007;
const int INF = 1034567890;
const long long LL_INF = 1234567890123456789ll;
const double PI = acos(-1);
const long double ERR = 1E-10;
int dis[505][505];
vector<int> rdis[505][505];
vector<int> V;
long double prob[505];
long double mxp[505];
int chk[505];
inline bool isEqual(long double a, long double b) { return abs(a - b) <= ERR; }
int main() {
  int N, M, i, j, k, l;
  scanf("%d %d", &N, &M);
  for (i = 1; i <= N; i++)
    for (j = 1; j <= N; j++)
      if (i != j) dis[i][j] = INF;
  while (M--) {
    scanf("%d %d", &i, &j);
    dis[i][j] = dis[j][i] = 1;
  }
  for (k = 1; k <= N; k++) {
    for (i = 1; i <= N; i++) {
      for (j = 1; j <= N; j++) {
        dis[i][j] = min(dis[i][k] + dis[k][j], dis[i][j]);
      }
    }
  }
  for (i = 1; i <= N; i++)
    for (j = 1; j <= N; j++) rdis[i][dis[i][j]].push_back(j);
  long double ans = 0;
  for (i = 1; i <= N; i++) {
    long double totp = 0;
    for (j = 0; !rdis[i][j].empty(); j++) {
      long double tp = 0;
      fill(prob + 1, prob + N + 1, 0);
      for (auto it : rdis[i][j]) {
        int c = 0;
        for (k = 1; k <= N; k++)
          if (dis[it][k] == 1) c++;
        for (k = 1; k <= N; k++)
          if (dis[it][k] == 1) prob[k] += 1.0 / (c * N);
      }
      for (k = 1; k <= N; k++)
        if (!isEqual(prob[k], 0)) V.push_back(k);
      fill(chk + 1, chk + N + 1, 0);
      for (k = 1; k <= N; k++) {
        long double tp2 = 0;
        for (auto it : V) {
          int d = dis[k][it];
          if (chk[d] != k) {
            chk[d] = k;
            tp2 += prob[it];
            mxp[d] = prob[it];
          } else {
            tp2 += max((long double)0, prob[it] - mxp[d]);
            mxp[d] = max(mxp[d], prob[it]);
          }
        }
        tp = max(tp, tp2);
      }
      totp += max(tp, (long double)1.0 / N);
      V.clear();
    }
    ans = max(ans, totp);
  }
  return !printf("%.20lf\n", (double)ans);
}
