#include <bits/stdc++.h>

using namespace std;

#ifdef NeverBeRed
#include "debug.h"
#else
#define debug(...) 9715
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second

ld dp[2][605];

int main()
{
	#ifdef TurnRed
		freopen("a.in", "r", stdin);
		//freopen("a.out", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n, m;
	cin >> n >> m;
	vector<vector<int>> adj(n);
	for (int u, v; m--; )
	{
		cin >> u >> v;
		--u, --v;
		adj[u].push_back(v);
	}

	ld ans = 1e60;
	for (int i = 0; i < n; ++i)
	{
		memset(dp, 0, sizeof dp);
		for (int u = n-2; u >= 0; --u)
		{
			int sz = adj[u].size();
			for (auto v : adj[u]) dp[0][u] += dp[v==i][v];
			dp[0][u] = dp[0][u] / sz + 1;
			dp[1][u] = dp[0][u];
			if (sz > 1 && u == i)
			{
				ld s = 0;
				for (auto v : adj[u])
					s += dp[0][v];
				for (auto v : adj[u])
					dp[1][u] = min(dp[1][u], (s - dp[0][v]) / (sz-1) + 1);
			}
		}
		ans = min(ans, dp[1][0]);
	}
	cout << setprecision(20) << fixed << ans << "\n";

	return 0;
}
