#include<iostream>
#include<vector>
#include<iomanip>
#include<float.h>
using namespace std;
using uint = unsigned int;

int main() {
	uint N, M;
	cin >> N >> M; 
	
	vector<vector<uint>> nodes(N);
	uint s, t;
	
	for(uint m=0; m<M; m++) {
		cin >> s >> t;
		nodes[s-1].push_back(t-1);
	}
	
	double ans = DBL_MAX;
	
	for(uint j=0; j<N; j++) {
		vector<double> e_dists(N);
		for(int i=N-2; i>=0; i--) {
			double max_dist = 0;
			double n_dist = 0;
			
			for(uint k=0; k<nodes[i].size(); k++) {
				n_dist += e_dists[nodes[i][k]];
				max_dist = max(max_dist, e_dists[nodes[i][k]]);
			}
			
			if ((nodes[i].size() > 1) && (i == j)) {
				e_dists[i] = 1 + (n_dist - max_dist) / (nodes[i].size() - 1);
			} else {
				e_dists[i] = 1 + n_dist / nodes[i].size();
			}
		}
		ans = min(ans, e_dists[0]);
	}
	
	cout << std::setprecision(7) << ans;
	
	return 0;
}