#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> g(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
  }
  double ans = 1e18;
  for (int erase = -1; erase < n; erase++) {
    vector<double> dp(n);
    for (int cur = n - 2; cur >= 0; cur--) {
      double sum = 0, mx = 0;
      for (int nxt : g[cur]) {
        sum += dp[nxt];
        mx = max(mx, dp[nxt]);
      }
      if (cur == erase && (int) g[cur].size() > 1) {
        dp[cur] += (sum - mx) / ((int) g[cur].size() - 1) + 1;
      } else {
        dp[cur] += sum / ((int) g[cur].size()) + 1;
      }
    }
    ans = min(ans, dp[0]);
  }
  cout << setprecision(20) << fixed << ans << '\n';
  return 0;
}