#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define all(X) X.begin(),X.end()

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   str.substr (x) : returns a substring str[x],... end of string
   str.find(qtr) : returns the first occurenece of qtr in str */

const int M = 1000;
const int md = 1e9+7;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

queue<ll> q;
ll vis[M],deg[M];
ld pr[M],dp[M],dp2[M],out[M];
vector<ll> adj[M];

void dfs(ll u)
{
	vis[u] = 1;
	ld mn = 0;
	for(auto v:adj[u])
	{
		if(vis[v] == 0)
			dfs(v);
		dp[u] += dp[v]+1;
		mn = max(mn,dp[v]+1.0);
	}
	if(adj[u].empty())
		return;
	ll sz = adj[u].size();
	dp[u] /= (ld)(sz);
	dp2[u] = dp[u];
	if (sz > 1) {
		for (int v: adj[u]) {
			dp2[u] = min(dp2[u], (dp[u]*sz - dp[v] - 1) / (sz - 1));
		}
	}
	return;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	ll n,m,i,u,v;
	ld ans = 1e15;

	cin >> n >> m;
	for(i=1;i<=m;++i)
	{
		cin >> u >> v;
		adj[u].pb(v);
		deg[v]++;
		out[u] += 1.0;
	}
	dfs(1);

	q.push(1);
	pr[1] = 1.0;
	ans = dp[1];
	// cout << ans << endl;

	while(!q.empty())
	{
		u = q.front();
		q.pop();
		ans = min(ans,dp[1]-pr[u]*dp[u]+pr[u]*dp2[u]);
		for(auto v:adj[u])
		{
			deg[v]--;
			pr[v] = pr[v] + (pr[u]/out[u]);
			if(deg[v] == 0)
				q.push(v);
		}
	}

	cout << setprecision(10) << fixed << ans << "\n";
	return 0;
}

	