#include <bits/stdc++.h>
using namespace std;
struct EDGE {
  int u, v, next;
} edge[160000];
int head[400 + 10], pp, deg[400 + 10];
void adde(int u, int v) {
  edge[++pp] = (EDGE){u, v, head[u]};
  deg[u]++;
  head[u] = pp;
}
int d[400 + 10][400 + 10], que[400 + 10][400 + 10], he, ta;
int n;
void bfs(int s, int *d, int *que) {
  for (int i = 1; i <= n; i++) d[i] = -1;
  que[he = ta = 1] = s;
  d[s] = 0;
  while (he <= ta) {
    int u = que[he++];
    for (int i = head[u]; i; i = edge[i].next) {
      int v = edge[i].v;
      if (d[v] == -1) d[v] = d[u] + 1, que[++ta] = v;
    }
  }
}
int cnt[400 + 10], sta[400 + 10], t;
double maxv[400 + 10], tot[400 + 10];
bool vis[400 + 10];
int main() {
  int m;
  scanf("%d%d", &n, &m);
  while (m--) {
    int u, v;
    scanf("%d%d", &u, &v);
    adde(u, v);
    adde(v, u);
  }
  for (int i = 1; i <= n; i++) bfs(i, d[i], que[i]);
  double ans = 0;
  for (int u = 1; u <= n; u++) {
    double sum = 0, p = 0;
    int pre = 0;
    while (pre < n) {
      int cur = pre;
      double cp = 1.0 / n;
      while (cur < n && d[u][que[u][cur + 1]] == d[u][que[u][pre + 1]]) cur++;
      int sum = 0;
      for (int i = pre + 1; i <= cur; i++) {
        int v = que[u][i];
        for (int i = head[v]; i; i = edge[i].next) {
          int u = edge[i].v;
          if (tot[u] == 0) sta[++t] = u;
          tot[u] += 1.0 / deg[v] / (cur - pre);
        }
      }
      for (int v = 1; v <= n; v++) {
        for (int i = 1; i <= t; i++) maxv[d[v][sta[i]]] = vis[d[v][sta[i]]] = 0;
        for (int i = 1; i <= t; i++)
          maxv[d[v][sta[i]]] = max(maxv[d[v][sta[i]]], tot[sta[i]]);
        double cpp = 0;
        for (int i = 1; i <= t; i++)
          if (!vis[d[v][sta[i]]])
            cpp += maxv[d[v][sta[i]]], vis[d[v][sta[i]]] = 1;
        cp = max(cpp * (cur - pre) / n, cp);
      }
      for (int i = 1; i <= t; i++) tot[sta[i]] = 0;
      t = 0;
      pre = cur;
      p += cp;
    }
    ans = max(ans, p);
  }
  printf("%.10lf\n", ans);
  return 0;
}
