#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
const int maxn = 100 + 5;
const int maxlist = 2 * 100 * 100 + 5;
int U[maxlist], prevl[maxlist], last[maxn];
bool used[maxn];
long long P[maxn], Pp[maxn], cnt[maxn];
int D[maxn];
int Q[maxn];
int lcnt = 1;
void add(int v, int u) {
  U[lcnt] = u;
  prevl[lcnt] = last[v];
  last[v] = lcnt++;
}
int paths;
int police_paths;
int n, m;
void bfs(int v, int police) {
  memset(used, 0, sizeof(used));
  memset(P, 0, sizeof(P));
  memset(Pp, 0, sizeof(Pp));
  memset(cnt, 0, sizeof(cnt));
  D[v] = 0;
  cnt[v] = 1;
  int l = 0, r = 0;
  Q[l] = v;
  used[v] = true;
  while (l <= r) {
    int v = Q[l++];
    for (int x = last[v]; x; x = prevl[x]) {
      int u = U[x];
      if (used[u]) {
        if (D[u] == D[v] + 1) {
          cnt[u] += cnt[v];
          P[u] += P[v] + cnt[v];
          Pp[u] += Pp[v];
          if (v == police || u == police) {
            Pp[u] += cnt[v];
          }
        }
      } else {
        used[u] = true;
        Q[++r] = u;
        D[u] = D[v] + 1;
        cnt[u] = cnt[v];
        P[u] = P[v] + cnt[v];
        Pp[u] = Pp[v];
        if (v == police || u == police) {
          Pp[u] += cnt[v];
        }
      }
    }
  }
}
long double func(int police) {
  bfs(0, police);
  return (long double)Pp[n - 1] / cnt[n - 1];
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int v, u;
    cin >> v >> u;
    --v, --u;
    add(v, u);
    add(u, v);
  }
  long double res = 0;
  for (int ansv = 0; ansv < n; ++ansv) {
    res = max(res, func(ansv));
  }
  cout.setf(ios::fixed);
  cout.precision(8);
  cout << res;
  return 0;
}
