#include<bits/stdc++.h>
 
#define ll long long int
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f

 
using namespace std;
const int N=601, mod= 1e9+7;
vector<int> g[N];
vector<long double> dp1(N),dp2(N);

int main(){
	ios_base::sync_with_stdio(0);	cin.tie(0);
	int n,m;
	
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int u,v;
		cin>>u>>v;
		g[u].pb(v);
	}
	
	for(int i=n-1;i>0;i--){
		for(auto v:g[i]){
			dp1[i]+=dp1[v]+1;
		}
		dp1[i]/=g[i].size();
	}
	
	long double ans=dp1[1];
	
	
	for(int i=1;i<n;i++){
		if(g[i].size()<2) continue;
		
		long double mx=-1;
		for(auto j:g[i]){
			if( mx<dp1[j] ){
				mx=dp1[j];
			}
		}
		
		for(auto k:g[i]){
			if( dp1[k]==mx ){
				
				dp2[n]=0;
				for(int j=n-1;j>0;j--){
					dp2[j]=0;
					int ct=0;
					for(auto v:g[j]){
						if( i==j && v==k ) continue;
						ct++;
						dp2[j]+=dp2[v]+1;
					}
					dp2[j]/=ct;
				}
				ans=min(ans,dp2[1]);
				
			}
		}
		
		
	}
	
	
	cout<<fixed<<setprecision(8)<<ans<<"\n";
	
}
