#include <bits/stdc++.h>
using namespace std;
struct vertex {
  int np = 0, cnt = 0;
  double prob = 0.0;
  set<int> to;
};
int n, m;
pair<int, int> p[18000];
bool jdg[600];
vertex ver[600];
void dfs(int x) {
  ver[x].cnt++;
  if (ver[x].cnt < ver[x].np) return;
  for (auto &i : ver[x].to) {
    ver[i].prob += ver[x].prob / ver[x].to.size();
    dfs(i);
  }
}
void dec(int x) {
  if (--ver[x].np != 0) return;
  for (auto &i : ver[x].to) dec(i);
}
void inc(int x) {
  if (ver[x].np++ != 0) return;
  for (auto &i : ver[x].to) inc(i);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%d %d", &p[i].first, &p[i].second);
  sort(p, p + m);
  jdg[0] = true;
  for (int i = 0; i < m; i++) {
    if (jdg[p[i].first - 1]) {
      jdg[p[i].second - 1] = true;
      ver[p[i].first - 1].to.emplace(p[i].second - 1);
      ver[p[i].second - 1].np++;
    }
  }
  ver[0].prob = 1.0;
  double ans = 20000.0;
  for (int i = 0; i < m; i++) {
    if (!jdg[p[i].first - 1] || ver[p[i].first - 1].to.size() == 1) continue;
    for (int j = 1; j < n; j++) {
      ver[j].cnt = 0;
      ver[j].prob = 0.0;
    }
    ver[p[i].first - 1].to.erase(p[i].second - 1);
    dec(p[i].second - 1);
    dfs(0);
    double a = 0;
    for (int j = 0; j < n - 1; j++) a += ver[j].prob;
    ver[p[i].first - 1].to.emplace(p[i].second - 1);
    inc(p[i].second - 1);
    ans = min(ans, a);
  }
  for (int i = 1; i < n; i++) {
    ver[i].cnt = 0;
    ver[i].prob = 0.0;
  }
  dfs(0);
  double a = 0;
  for (int i = 0; i < n - 1; i++) a += ver[i].prob;
  ans = min(ans, a);
  printf("%5.15lf\n", ans);
  return 0;
}
