#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 400;
int n, m;
vector<int> adj[maxn + 5];
int dis[maxn + 5][maxn + 5];
double ans;
inline void bfs(int first, int *dis) {
  static bool vis[maxn + 5];
  memset(vis, 0, sizeof vis);
  queue<int> q;
  q.push(first), vis[first] = 1, dis[first] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto v : adj[u])
      if (!vis[v]) vis[v] = 1, q.push(v), dis[v] = dis[u] + 1;
  }
}
double inv[maxn + 5];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1), _end_ = (n + 1); i < _end_; ++i) inv[i] = 1. / i;
  for (int i = (0), _end_ = (m); i < _end_; ++i) {
    int u, v;
    scanf("%d%d", &u, &v), --u, --v;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  for (int i = (0), _end_ = (n); i < _end_; ++i) bfs(i, dis[i]);
  ans = 0;
  for (int i = (0), _end_ = (n); i < _end_; ++i) {
    double tmp = 0;
    for (int j = (0), _end_ = (n); j < _end_; ++j) {
      static double sum[maxn + 5];
      static bool vis[maxn + 5];
      memset(sum, 0, sizeof sum);
      memset(vis, 0, sizeof vis);
      int cnt = 0;
      for (int k = (0), _end_ = (n); k < _end_; ++k)
        if (dis[i][k] == j) {
          double per = inv[(int((adj[k]).size()))];
          for (auto l : adj[k]) sum[l] += per, vis[l] = 1;
          ++cnt;
        }
      if (!cnt) continue;
      vector<int> all;
      for (int k = (0), _end_ = (n); k < _end_; ++k)
        if (vis[k]) all.push_back(k);
      double ret = 1;
      static int num[maxn + 5];
      static double Max[maxn + 5];
      for (int k = (0), _end_ = (n); k < _end_; ++k) {
        for (auto tmp : all) num[dis[k][tmp]] = 0, Max[dis[k][tmp]] = 0;
        for (auto tmp : all)
          ++num[dis[k][tmp]], chkmax(Max[dis[k][tmp]], sum[tmp]);
        double foo = 0;
        for (auto tmp : all) foo += Max[dis[k][tmp]], Max[dis[k][tmp]] = 0;
        chkmax(ret, foo);
      }
      tmp += ret;
    }
    chkmax(ans, tmp);
  }
  ans *= inv[n];
  printf("%.15f\n", ans);
  return 0;
}
