#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll mod = 1000000007;
const ll mod998 = 998244353;
const ll intmax = 2147483647;
const ll llmax = 9223372036854775807;
const char sp = ' ';

int N, M, s, t;
double ex[600], res;
vector<int>v[600];

int main() {
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> s >> t;
		v[s - 1].push_back(t - 1);
	}
	for (int i = N - 2; i >= 0; i--) {
		for (int j : v[i]) {
			ex[i] += ex[j];
		}
		ex[i] /= v[i].size();
		ex[i] += 1;
	}
	res = ex[0];
	for (int i = 0; i < N - 1; i++) {
		if (v[i].size() == 1)continue;
		double EX[600];
		for (int j = i + 1; j < N; j++) {
			EX[j] = ex[j];
		}
		EX[i] = 0;
		double mx = 0;
		for (int j : v[i]) {
			EX[i] += EX[j];
			mx = max(mx, EX[j]);
		}
		EX[i] -= mx;
		EX[i] /= v[i].size() - 1;
		EX[i] += 1;
		for (int j = i - 1; j >= 0; j--) {
			EX[j] = 0;
			for (int k : v[j]) {
				EX[j] += EX[k];
			}
			EX[j] /= v[j].size();
			EX[j] += 1;
		}
		res = min(res, EX[0]);
	}
	printf("%.10f\n", res);
}
