#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
#define rep(i, l, r) for(int i = l; i <= (r); i ++ )
#define per(i, r, l) for(int i = r; i >= (l); i -- )
#define reps(i, l, r, d) for(int i = l; i <= (r); i += d)
#define pers(i, r, l, d) for(int i = r; i >= (l); i -= d)
constexpr int N = 610;
constexpr int P = 1e9 + 7;
int n, m;
vector<int> adj[N];
double e_1_i[N], e_i_n[N], p_1_i[N];
void solve()
{
cin >> n >> m;
while(m -- ) {
int u, v; cin >> u >> v;
adj[u].push_back(v);
}
per(u, n, 1) {
for(int v : adj[u]) {
e_i_n[u] += (1 + e_i_n[v]) / adj[u].size();
}
}
p_1_i[1] = 1;
rep(u, 1, n) {
for(int v : adj[u]) {
p_1_i[v] += p_1_i[u] / adj[u].size();
e_1_i[v] += (p_1_i[u] + e_1_i[u]) / adj[u].size();
}
}
rep(u, 1, n) {
cout << u << ' ' << e_1_i[u] << ' ' << e_i_n[u] << endl;
}
double ans = e_i_n[1];
// cerr << ans;
rep(u, 1, n) {
if(adj[u].size() == 1) continue;
double sum = 0;
for(int v : adj[u]) {
sum += e_1_i[u] / adj[u].size() + p_1_i[u] / adj[u].size() + p_1_i[u] * e_i_n[v] / adj[u].size();
}
// if(u == 1) cerr << sum << endl;
for(int v : adj[u]) {
double tmp = sum;
tmp -= e_1_i[u] / adj[u].size() + p_1_i[u] / adj[u].size() + p_1_i[u] * e_i_n[v] / adj[u].size();
tmp *= adj[u].size() / (adj[u].size() - 1.0);
// if(v == 2) cerr << tmp << endl;
ans = min(ans, e_i_n[1] - sum + tmp);
}
}
cout << fixed << setprecision(20) << ans << endl;
}
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
solve();
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgZW5kbCAnXG4nCnR5cGVkZWYgbG9uZyBsb25nI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MCk7IGNpbi50aWUoMCk7CgogICAgc29sdmUoKTsKCgogICAgcmV0dXJuIDA7Cn0=