#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
const double INF = 1e17;

int main(){
  int n, m;
  cin >> n >> m;
  vector<int> g[n];
  rep(i,m) {
    int s, t;
    cin >> s >> t;
    s--; t--;
    g[s].push_back(t);
  }
  double ans = INF;
  rep(i,n-1) {
    vector<double> dp(n,0);
    for(int j = n-2; j >= 0; j--) {
      if(g[j].size() == 1) {
        dp[j] = dp[g[j][0]] + 1.0;
      } else {
        double q = 0.0, m = 0.0;
        for(auto k : g[j]) {
          q += dp[k];
          if(m < dp[k]) m = dp[k];
        }
        if(j == i) dp[j] = 1.0 + (q-m)/(double)(g[j].size()-1);
        else dp[j] = 1.0 + q/(double)g[j].size();
      }
    }
    if(ans > dp[0]) ans = dp[0];
  }
  printf("%.9lf\n",ans);
  return 0;
}