Bearland has n cities, numbered 1 through n. There are m bidirectional roads. The i-th road connects two distinct cities ai and bi. No two roads connect the same pair of cities. It's possible to get from any city to any other city (using one or more roads).The distance between cities a and b is defined as the minimum number of roads used to travel between a and b.Limak is a grizzly bear. He is a criminal and your task is to catch him, or at least to try to catch him. You have only two days (today and tomorrow) and after that Limak is going to hide forever.Your main weapon is BCD (Bear Criminal Detector). Where you are in some city, you can use BCD and it tells you the distance between you and a city where Limak currently is. Unfortunately, BCD can be used only once a day.You don't know much about Limak's current location. You assume that he is in one of n cities, chosen uniformly at random (each city with probability ). You decided for the following plan:  Choose one city and use BCD there.   After using BCD you can try to catch Limak (but maybe it isn't a good idea). In this case you choose one city and check it. You win if Limak is there. Otherwise, Limak becomes more careful and you will never catch him (you loose).   Wait 24 hours to use BCD again. You know that Limak will change his location during that time. In detail, he will choose uniformly at random one of roads from his initial city, and he will use the chosen road, going to some other city.  Tomorrow, you will again choose one city and use BCD there.  Finally, you will try to catch Limak. You will choose one city and check it. You will win if Limak is there, and loose otherwise. Each time when you choose one of cities, you can choose any of n cities. Let's say it isn't a problem for you to quickly get somewhere.What is the probability of finding Limak, if you behave optimally?

The first line of the input contains two integers n and m (2 ≤ n ≤ 400, ) — the number of cities and the number of roads, respectively. Then, m lines follow. The i-th of them contains two integers ai and bi (1 ≤ ai, bi ≤ n, ai ≠ bi) — cities connected by the i-th road. No two roads connect the same pair of cities. It's possible to get from any city to any other city.

Print one real number — the probability of finding Limak, if you behave optimally. Your answer will be considered correct if its absolute error does not exceed 10 - 6. Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct if |a - b| ≤ 10 - 6.

NoteIn the first sample test, there are three cities and there is a road between every pair of cities. Let's analyze one of optimal scenarios.  Use BCD in city 1.   With probability  Limak is in this city and BCD tells you that the distance is 0. You should try to catch him now and you win for sure.  With probability  the distance is 1 because Limak is in city 2 or city 3. In this case you should wait for the second day.   You wait and Limak moves to some other city.   There is probability  that Limak was in city 2 and then went to city 3.   that he went from 2 to 1.   that he went from 3 to 2.   that he went from 3 to 1.   Use BCD again in city 1 (though it's allowed to use it in some other city).   If the distance is 0 then you're sure Limak is in this city (you win).  If the distance is 1 then Limak is in city 2 or city 3. Then you should guess that he is in city 2 (guessing city 3 would be fine too).  You loose only if Limak was in city 2 first and then he moved to city 3. The probability of loosing is . The answer is .

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <math.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int inf = 0x3f3f3f3f;

const int maxn=444;
int n,m;
vector<int> g[maxn];
vector<int> dg[maxn];
int dis[maxn][maxn];

void add_edge(int u,int v){
	g[u].push_back(v);
	g[v].push_back(u);
}

void floyd(){
	for (int u = 1; u <= n; ++u)
	{
		dis[u][u]=0;
	}

	for (int k = 1; k <= n; ++k)
	{
		for (int i = 1; i <= n; ++i)
		{
			for (int j = 1; j <= n; ++j)
			{
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

double mx[maxn];
double probability[maxn];
bool used[maxn];
vector<int> p;
double solve(vector<int> dg){
	memset(probability,0,sizeof probability);
	memset(used,false,sizeof used);
	p.clear();

	for (int i = 0; i < dg.size(); ++i)
	{
		int u=dg[i];
		for (int j = 0; j < g[u].size(); ++j)
		{
			int v=g[u][j];
			probability[v]+=1.0/n/g[u].size();
			if(used[v]==false){
				used[v]=true;
				p.push_back(v);
			}
		}
	}

	double ans=0;

	//for (int i = 0; i < p.size(); ++i)
	for(int u=1; u<=n; u++)
	{
		memset(mx,0,sizeof mx);
		//int u=p[i];
		double aux=0;
		for (int j = 0; j < p.size(); ++j)
		{
			int v=p[j];
			if(mx[dis[u][v]]<probability[v]){
				aux+=probability[v]-mx[dis[u][v]];
				mx[dis[u][v]]=probability[v];
			}
		}
		ans=max(ans,aux);
	}
	return ans;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
#endif

    scanf("%d%d",&n,&m);
    memset(dis,0x3f,sizeof dis);
    for (int i = 0; i < m; ++i)
    {
    	int u,v;
    	scanf("%d%d",&u,&v);
    	add_edge(u,v);
    	dis[u][v]=dis[v][u]=1;
    }

    floyd();
    double ans=0;
    for (int i = 1; i <= n; ++i)
    {
    	double aux=1.0/n;
    	for (int j = 0; j <= n; ++j)
    	{
    		dg[j].clear();
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		dg[dis[i][j]].push_back(j);
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		if(dg[j].size()==1) aux+=1.0/n;
    		else if(dg[j].size()>1)	aux+=max(1.0/n,solve(dg[j]));
    	}
    	ans=max(ans,aux);
    }
    printf("%.12f\n",ans);
    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
#include <cctype>
#include <list>
#include <assert.h>
#include <random>
#include <unordered_map>
#include <ctime>
typedef  long long ll;
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD 1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef pair<int, int> pii;
typedef long double ld;
typedef unsigned int uint;
#define MAX 405
bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="RDLU";
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"Yes" : "No");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD) {
    x+=y; if (x>=mod) x-=mod;
}
void et() {
    puts("-1"); exit(0);
}

int dis[MAX][MAX];
vector<int> mp[MAX],V;
ld to[MAX], todis[MAX];
bool vis[MAX];
ld cal(int g1, int dist1) {
    vector<int> vp;
    REQ(i,n) { to[i]=0; vis[i]=0;}
    for(int c:V) {
        for(int z:mp[c]) {
            to[z] += (ld)1/V.size() /mp[c].size();
            if (!vis[z]) {
                vis[z]=1; vp.push_back(z);
            }
        }
    }
    ld ans = 0;
    REQ(g2, n) {
        ld tmp = 0;
        for(int z: vp) todis[dis[g2][z]] = max(to[z], todis[dis[g2][z]]);
        for(int z: vp) {
            tmp += todis[dis[g2][z]]; todis[dis[g2][z]]=0;
        }
        ans = max(ans, tmp);
    }
    return ans;
}
void fmain() {
    scanf("%d%d", &n, &m);
    REQ(i,n) REQ(j,n) dis[i][j]=i==j?0:inf9;
    for(int i=0,u,v;i<m;i++) {
        scanf("%d%d", &u, &v); mp[u].push_back(v); mp[v].push_back(u);
        dis[u][v]=dis[v][u]=1;
    }
    REQ(k,n) REQ(i,n) REQ(j,n) dis[i][j] = min(dis[i][j], dis[i][k]+dis[k][j]);

    ld ans = 0;
    REQ(g1,n) {
        ld wAns=0;
        REP(dist1, n) {
            V.clear();
            REQ(i,n) if (dis[g1][i]==dist1) {
                V.push_back(i);
            }
            if (V.empty()) continue;
            ld curP = (ld)V.size()/n;

            ld guess1 = 1.0/V.size();
            ld guess2 = cal(g1, dist1);
//            cout<<guess1<<" "<<guess2<<endl;
            wAns += max(guess1, guess2) * curP;
        }
        ans = max(ans, wAns);
    }
    printf("%.10Lf\n", ans);
}
int main() {
    fmain();
    return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=405;
int dis[maxn][maxn];
vector<int>g[maxn];
double vis[maxn];
bool use[maxn];
vector<int>gg,gg1;
double s1[maxn];
double s2[maxn];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            dis[i][j]=dis[j][i]=100000000;
        }
    }
    for(int i=0;i<m;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        g[x].push_back(y);
        g[y].push_back(x);
        dis[x][y]=1;
        dis[y][x]=1;
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int f=1;f<=n;f++){
                dis[j][f]=min(dis[j][f],dis[j][i]+dis[i][f]);
            }
        }
    }
    double ans=0;
    for(int i=1;i<=n;i++){
        double aa=1.0/n;
        for(int j=1;j<=n;j++){
            for(int f=1;f<=n;f++){
                vis[f]=0;
                use[f]=0;
            }
            gg.clear();
            int q=0;
            for(int f=1;f<=n;f++){
                if(dis[i][f]==j){
                    int p=g[f].size();
                    for(int v:g[f]){
                        if(!use[v]){
                            gg.push_back(v);
                        }
                        vis[v]+=1.0/p*1.0/n;
                        use[v]=1;
                    }
                    q++;
                }
            }
            if(gg.size()==0) continue;
            memset(use,0,sizeof(use));
            double ans1=1.0/n;
            for(int f=1;f<=n;f++){
                double s=0;
                for(int v:gg){
                    if(!use[dis[f][v]]){
                        use[dis[f][v]]=1;
                        gg1.push_back(dis[f][v]);
                    }
                    s2[dis[f][v]]=max(s2[dis[f][v]],vis[v]);
                }
                for(int v:gg1){
                    double p;
                    p=s2[v];
                    s+=p;
                    s2[v]=0;
                    use[v]=0;
                }
                gg1.clear();
                ans1=max(ans1,s);
            }
            aa+=ans1;
        }
        aa=aa;
        ans=max(ans,aa);
    }
    printf("%.10lf\n",ans);
}

#include<bits/stdc++.h>

#define x first
#define y second
#define pb push_back

using namespace std;

typedef long long INT;
typedef vector<int> VI;
typedef pair<int, int> pii;

template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}
template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}
int power(int a, int b, int m, int ans=1){for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m; return ans;}

typedef double DO;
#define NN 410
int n, d[NN][NN];
VI vec[NN][NN];
DO p[NN], mmx[NN];

DO calc(int f){
	DO ans=0;
	for(int l=0; l<n; l++) if(!vec[f][l].empty()){
		if(vec[f][l].size()==1){
			ans+=1.0/n;
			continue;
		}
		for(int i=1; i<=n; i++) p[i]=0;
		VI nxt;
		for(int v : vec[f][l]){
			DO x=1.0/n/vec[v][1].size();
			for(int w : vec[v][1]){
				if(p[w]<1e-9) nxt.pb(w);
				p[w]+=x;
			}
		}
		DO mx=1.0/n;
		for(int i=1; i<=n; i++){
			DO s=0;
			for(int w : nxt) smax(mmx[d[i][w]], p[w]);
			for(int w : nxt) s+=mmx[d[i][w]], mmx[d[i][w]]=0;
			smax(mx, s);
		}
		ans+=mx;
	}
	return ans;
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int m;
	cin >> n >> m;
	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) d[i][j]=(i!=j)*n;

	for(int i=0, u, v; i<m; i++){
		gn(u, v);
		d[u][v]=d[v][u]=1;
	}
	for(int k=1; k<=n; k++) for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) smin(d[i][j], d[i][k]+d[k][j]);
	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) vec[i][d[i][j]].pb(j);

	DO ans=0;
	for(int i=1; i<=n; i++) smax(ans, calc(i));

	printf("%.12lf\n", ans);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
typedef double T;
const int nax = 1005;
int dist[nax][nax];
vector<int> w[nax];
T p_later[nax]; // p[v] - probability for city v in the second day
T p_dist_max[nax];
bool vis[nax];

void max_self(T & a, T b) {
	a = max(a, b);
}

T consider_tomorrow(int n, int g1, int dist1) {
	T best_tomorrow = 0;
	// we need complexity O(n * x)
	// where x denotes the number of v that |dist1-dist[g1][v]| <= 1
	for(int i = 1; i <= n; ++i) {
		p_later[i] = 0;
		vis[i] = false;
	}
	vector<int> interesting;
	for(int v = 1; v <= n; ++v) if(dist[g1][v] == dist1)
		for(int b : w[v]) {
			// Limak started in v with prob. 1/n
			// he then moved to b with prob. 1/degree[v]
			p_later[b] += (T) 1 / n / w[v].size();
			if(!vis[b]) {
				vis[b] = true;
				interesting.push_back(b);
			}
		}

	// interesting.size() <= x, where x is defined above (needed for complexity)
	for(int g2 = 1; g2 <= n; ++g2) {
		T local_sum = 0; // over situations with fixed g1, dist1, g2

		for(int b : interesting)
			max_self(p_dist_max[dist[g2][b]], p_later[b]);
		for(int b : interesting) {
			local_sum += p_dist_max[dist[g2][b]];
			p_dist_max[dist[g2][b]] = 0; // so it won't be calculated twice
		}
		max_self(best_tomorrow, local_sum);
	}
	return best_tomorrow;
}

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	FOR(i,1,n) FOR(j, 1, n) if(i != j)
		dist[i][j] = n + 1; // infinity
	FOR(i,1,m) {
		int a, b;
		scanf("%d%d", &a, &b);
		w[a].push_back(b);
		w[b].push_back(a);
		dist[a][b] = dist[b][a] = 1;
	}
	// Floyd-Warshall
	FOR(b,1,n)FOR(a,1,n)FOR(c,1,n)
		dist[a][c] = min(dist[a][c], dist[a][b] + dist[b][c]);

	// g1 is the first guess
	T answer = 0;
	FOR(g1, 1, n) {
		T sum_over_dist1 = 0;
		FOR(dist1, 0, n) {
			int cnt_cities = 0;
			FOR(i, 1, n) if(dist[g1][i] == dist1)
				++cnt_cities;
			if(cnt_cities == 0) continue; // there are no cities within distance dist1

			// 1) consider guessing immediately
			T immediately = (T) 1 / n; // how much it counts towards the answer
			// 2) consider waiting for tomorrow
			T second_day = consider_tomorrow(n, g1, dist1);
			sum_over_dist1 += max(immediately, second_day);
		}
		max_self(answer, sum_over_dist1);
	}
    cout << answer << endl;
	return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define N 510
#define M 250010
using namespace std;
int V[M], nxt[M], p[N], du[N], d[N][N], q[N], ed, n, i, j, m;
double c[N], trd[N], ans;
void add(int u, int v) {
	V[++ed] = v, nxt[ed] = p[u], p[u] = ed, ++du[v];
}
double next(int x, int ds) {
	double ans = 0, _ans = 0;
	memset(c, 0, sizeof(c));
	int tot = 0, i, j;
	for (i = 1; i <= n; i++) {
		if (d[x][i] != ds) continue;
		for (j = p[i]; j != -1; j = nxt[j])
			c[V[j]] += 1.0 / n / du[i];
	}
	for (i = 1; i <= n; i++)
		if (c[i] > 1e-6) q[++tot] = i;
	for (i = 1; i <= n; i++, ans = 0) { //day 2 the police
		for (j = 1; j <= tot; j++)
			trd[d[i][q[j]]] = max(trd[d[i][q[j]]], c[q[j]]);
		for (j = 1; j <= tot; j++)
			ans += trd[d[i][q[j]]], trd[d[i][q[j]]] = 0;
		_ans = max(ans, _ans);
	}
	return _ans;
}
int main() {
	memset(p, -1, sizeof(p));
	scanf("%d%d", &n, &m);
	for (i = 1; i <= n; i++)
		for (j = 1; j <= n; j++)
			d[i][j] = (i == j ? 0 : n + 1);
	for (i = 1; i <= m; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		add(u, v), add(v, u);
		d[u][v] = d[v][u] = 1;
	}
	for (int k = 1; k <= n; k++)
		for (i = 1; i <= n; i++)
			for (j = 1; j <= n; j++)
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
	for (i = 1; i <= n; i++) { //day 1 the police
		double ita = 0;
		for (int ds = 0; ds < n; ds++) { //the distance
			bool flag = false;
			for (j = 1; j <= n; j++)
				if (d[i][j] == ds) {flag = true; break;}
			if (!flag) continue;
			ita += max(1.0 / n, next(i, ds));
		}
		ans = max(ans, ita);
	}
	printf("%.8f", ans);
	return 0;
}

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <vector>

// kalinov's libraries:

//
// lib/base/check.h
//
#define CHECK(condition) \
if (!(condition)) { \
  printf("CHECK(%s) failed\n", #condition); \
  exit(0); \
}

//
// lib/base/integral_types.h
//
typedef signed char int8;
typedef short int16;
typedef int int32;
typedef long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;

//
// lib/container/small_map.h
//
// Incomplete

template<typename K, typename V>
class SmallMap {
 public:
  V& operator[](const K& key) {
    for (int i = 0; i < data_.size(); ++i) {
      if (data_[i].first == key) return data_[i].second;
    }
    data_.push_back(std::pair<K, V>(key, V()));
    return data_.back().second;
  }
  void clear() {
    data_.clear();
  }
  typename std::vector<std::pair<K, V>>::iterator begin() {
    return data_.begin();
  }
  typename std::vector<std::pair<K, V>>::iterator end() {
    return data_.end();
  }
 private:
  std::vector<std::pair<K, V>> data_;
};

//
// lib/container/small_set.h
//
// Incomplete

template<typename T>
class SmallSet {
 public:
  void insert(const T& value) {
    for (int i = 0; i < data_.size(); ++i) {
      if (data_[i] == value) return;
    }
    data_.push_back(value);
  }
  void clear() {
    data_.clear();
  }
  typename std::vector<T>::iterator begin() { return data_.begin(); }
  typename std::vector<T>::iterator end() { return data_.end(); }
 private:
  std::vector<T> data_;
};

//
// The real code follows:
//
using namespace std;

#define MAX 400

int n, m;
int g[MAX][MAX];
int deg[MAX];

double prob[MAX][MAX];
SmallSet<int> neighbour_x[MAX];
SmallMap<int, pair<double, double>> pairs[MAX];
int cnt_a[MAX];
double best[MAX];
double s[MAX];
double p[MAX];

double Solve() {
  double ret = 0.0;
  for (int a = 0; a < n; ++a) {
    for (int x = 0; x < n; ++x) cnt_a[x] = 0;
    for (int i = 0; i < n; ++i) {
      int x = g[a][i];
      ++cnt_a[x];
    }

    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        prob[i][j] = 0.0;
      }
      neighbour_x[i].clear();
    }

    for (int i = 0; i < n; ++i) {
      int x = g[a][i];
      for (int j = 0; j < n; ++j) {
        if (g[i][j] != 1) continue;
        prob[x][j] += (1.0 / cnt_a[x]) * (1.0 / deg[i]);
        neighbour_x[j].insert(x);
      }
    }

    for (int x = 0; x < n; ++x) {
      best[x] = cnt_a[x] == 0 ? 0.0 : 1.0 / n;
    }

    for (int b = 0; b < n; ++b) {
      for (int x = 0; x < n; ++x) {
        s[x] = 0.0;
        p[x] = 0.0;
      }
      for (int y = 0; y < n; ++y) pairs[y].clear();

      for (int i = 0; i < n; ++i) {
        int y = g[b][i];
        for (int x : neighbour_x[i]) {
          pair<double, double>& p = pairs[y][x];
          p.first += prob[x][i];
          p.second = max(p.second, prob[x][i]);
        }
      }

      for (int y = 0; y < n; ++y) {
        for (const auto& entry : pairs[y]) {
          int x = entry.first;
          s[x] += entry.second.first;
        }
      }
      for (int y = 0; y < n; ++y) {
        for (const auto& entry : pairs[y]) {
          int x = entry.first;
          p[x] += entry.second.second / entry.second.first *
                  entry.second.first / s[x];
        }
      }
      for (int x = 0; x < n; ++x) {
        if (cnt_a[x] == 0) continue;
        best[x] = max(best[x], p[x] * cnt_a[x] / n);
      }
    }
    double sum_best = 0;
    for (int x = 0; x < n; ++x) sum_best += best[x];
    ret = max(ret, sum_best);
  }
  return ret;
}

int main() {
  CHECK(scanf("%d%d", &n, &m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      g[i][j] = MAX;
    }
    g[i][i] = 0;
  }
  for (int i = 0; i < m; ++i) {
    int a, b;
    CHECK(scanf("%d%d", &a, &b));
    ++deg[a - 1];
    ++deg[b - 1];
    g[a - 1][b - 1] = 1;
    g[b - 1][a - 1] = 1;
  }
  for (int k = 0; k < n; ++k) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
      }
    }
  }
  printf("%.10lf\n", Solve());

  return 0;
}

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <list>
#include <bitset>
#include <vector>
using namespace std;

#define LL __int64

#define fi first
#define se second
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(a,b) (((a)+(b))>>1)
#define maxx(a,b) ((a)<(b)?(b):(a))
#define minx(a,b) ((a)<(b)?(a):(b))
#define absx(a) ((a)<0?-(a):(a))
#define mk(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define itr iterator
#define lowbit(x) ((x)&-(x))

typedef unsigned LL ULL;
typedef unsigned uint;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pll;
typedef vector<int> vi;

template< typename T >
inline void read(T &res)
{
    T x=0; bool f=0; char ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-')f=!f; ch=getchar();}
    while(ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    res = f ? -x : x ;
}

template< typename T >
inline void Max(T &a, T b) {if(a<b) a=b;}
template< typename T >
inline void Min(T &a, T b) {if(b<a) a=b;}

const double pi=(double) acos(-1.0);
const int MOD=(int) 1e9+7;
const int INF=(int) 0x3f3f3f3f;
const LL  LINF=(LL) INF<<32|INF;
const int SINF=(uint) ~0>>1;
const LL  SLINF=(ULL) (-1)>>1;
const double DINF=(double) 1e50;
const double eps=(double) 1e-8;
const int maxn=(int) 4e2+20;
const int maxm=(int) 1e6+15;

inline int sig(double x) {return x<-eps?-1:x>eps;}
inline void fadd(LL &x,LL a) {x+=a; if(x>=MOD) x-=MOD;}

//--------------start------------------

int n,m;
vi G[maxn];
int dis[maxn][maxn];
int dd[maxn][maxn];

double mx_pro[maxn],pro[maxn];
bool vis[maxn];
vector<int> tar;

double get_next(int x,int d)
{
    memset(vis,0,sizeof(vis));
    memset(pro,0,sizeof(pro));

    tar.clear();
    for(int i=1;i<=n;i++)
    {
        if(dis[x][i]!=d) continue;
        int sz=G[i].size();
        for(int j=0;j<sz;j++)
        {
            int v=G[i][j];
            pro[v]+=1.0/(sz*n);
            if(!vis[v])
            {
                vis[v]=1;
                tar.pb(v);
            }
        }
    }

    double res=0.0;
    for(int i=1;i<=n;i++)
    {
        int sz=tar.size();
        for(int j=0;j<sz;j++)
        {
            int v=tar[j];
            Max(mx_pro[dis[i][v]],pro[v]);
        }
        double temp_sum=0.0;
        for(int j=0;j<sz;j++)
        {
            int v=tar[j];
            temp_sum+=mx_pro[dis[i][v]];
            mx_pro[dis[i][v]]=0.0;
        }
        Max(res,temp_sum);
    }

    return res;
}

void work()
{
    while(~scanf("%d%d",&n,&m))
    {
        memset(dis,0x3f,sizeof(dis));
        for(int i=1;i<=n;i++) dis[i][i]=0, G[i].clear();
        for(int i=0;i<m;i++)
        {
            int x,y; read(x), read(y);
            G[x].pb(y); G[y].pb(x);
            dis[x][y]=dis[y][x]=1;
        }

        for(int k=1;k<=n;k++)
            for(int i=1;i<=n;i++)
                for(int j=1;j<=n;j++)
                    Min(dis[i][j],dis[i][k]+dis[k][j]);

        memset(dd,0,sizeof(dd));
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                if(dis[i][j]<=n)
                    dd[i][dis[i][j]]++;

        double ans=0.0;
        for(int i=1;i<=n;i++)
        {
            double Pros=0.0;
            for(int d=0;d<n;d++)
            {
                if(!dd[i][d]) continue;
                Pros+=max(1.0/(double)n,get_next(i,d));
            }
            Max(ans,Pros);
        }
        printf("%.12lf\n",ans);
    }
}

//--------------end--------------------

//#define yukihana0416
int main()
{
#ifdef yukihana0416
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // yukihana0416
    work();
    return 0;
}

#ifdef __GNUC__
#pragma GCC target("sse4,avx")
#endif
#include <immintrin.h>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <cstdint>
#include <numeric>

struct Solution {
  int n;
  std::vector<std::vector<int>> graph;
  std::vector<std::vector<int>> matrix;
  int counter;
  std::vector<int> dirtyFlags;
  std::vector<double> maxProbs;

  double checkFirst(int a) {
    double res = 0;
    for (int dist = 0; dist < n; dist++) {
      std::vector<int> group;
      for (int i = 0; i < n; i++) {
        if (matrix[a][i] == dist) {
          group.push_back(i);
        }
      }
      if (group.size() == 0) continue;
      double caseProb = group.size() / (double) n;
      double c = 1.0 / group.size();
      double ans = c;
      std::vector<double> t(n);
      for (int v : group) {
        for (int nv : graph[v]) {
          t[nv] += c / graph[v].size();
        }
      }
      std::vector<int> groupT;
      std::vector<double> groupTD;
      for (int i = 0; i < n; i++) {
        if (t[i] > 1e-20) {
          groupT.push_back(i);
          groupTD.push_back(t[i]);
        }
      }
      for (int b = 0; b < n; b++) {
        counter++;
        double cur = 0;
        for (size_t i = 0; i < groupT.size(); i++) {
          int v = groupT[i];
          double tv = groupTD[i];
          int d = matrix[b][v];
          if (dirtyFlags[d] == counter) {
            if (tv > maxProbs[d]) {
              cur += tv - maxProbs[d];
              maxProbs[d] = tv;
            }
          } else {
            dirtyFlags[d] = counter;
            maxProbs[d] = tv;
            cur += tv;
          }
        }
        ans = std::max(ans, cur);
      }
      res += caseProb * ans;
    }
    return res;
  }

  void run(std::istream& in, std::ostream& out) {
    int m;
    in >> n >> m;
    graph.clear();
    graph.resize(n);
    matrix.clear();
    matrix.resize(n, std::vector<int>(n, 1000000));
    for (int i = 0; i < n; i++) {
      matrix[i][i] = 0;
    }
    for (int i = 0; i < m; i++) {
      int a, b;
      in >> a >> b;
      a--;b--;
      graph[a].push_back(b);
      graph[b].push_back(a);
      matrix[a][b] = 1;
      matrix[b][a] = 1;
    }
    for(int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        for (int k = 0; k < n; k++) {
          matrix[j][k] = std::min(matrix[j][k], matrix[j][i] + matrix[i][k]);
        }
      }
    }

    counter = 0;
    dirtyFlags.resize(n);
    maxProbs.resize(n);

    double ans = 0;
    for (int a = 0; a < n; a++) {
      ans = std::max(ans, checkFirst(a));
    }
    out.precision(12);
    out << ans << std::endl;
  }
};

int main() {
  std::cin.sync_with_stdio(false);
  std::cin.tie(nullptr);
  Solution().run(std::cin, std::cout);
  return 0;
}//hellobig_tq

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define MP make_pair
#define N 401

vector< vector<int> > adj(N);
vector< vector< vector<int> > > distanceList(N);
int d[N][N], n;
double p[N], s[N][N], dp[N];
bool visited[N];

void bfsTraversal(int s){
	int i, j, k;

	for(i = 0; i <= n; i++)
		d[s][i] = N;

	d[s][s] = 0;

	queue<int> q;
	q.push(s);

	while(!q.empty()){
		i = q.front();
		q.pop();

		for(j = 0; j < adj[i].size(); j++){
			k = adj[i][j];
			if(d[s][k] == N){
				d[s][k] = d[s][i] + 1;
				q.push(k);
			}
		}
	}

	for(i = 1, k = 0; i <= n; i++)
		k = max(k,d[s][i]);

	distanceList[s].resize(k + 1);

	for(i = 1; i <= n; i++)
		distanceList[s][d[s][i]].PB(i);
}

int main(){
	int m, i, j, k, x, y, z, t;
	double f, ansx, ans = 0;

	scanf("%d%d", &n, &m);

	while(m--){
		scanf("%d%d", &i, &j);
		adj[i].PB(j);
		adj[j].PB(i);
	}

	for(i = 1; i <= n; i++)
		bfsTraversal(i);

	for(i = 1; i <= n; i++){
		ansx = 0;

		for(x = 1; x < distanceList[i].size(); x++){
			for(y = 0; y < distanceList[i][x].size(); y++){
				j = distanceList[i][x][y];

				f = 1.0 / n;
				f /= adj[j].size();

				for(z = 0; z < adj[j].size(); z++){
					k = adj[j][z];
					p[k] += f;
					visited[k] = 1;
				}
			}

			for(j = 1; j <= n; j++){
				if(visited[j] == 0)
					continue;

				for(k = 1; k <= n; k++){
					z = d[j][k];

					if(p[j] > s[k][z]){
						dp[k] += (p[j] - s[k][z]);
						s[k][z] = p[j];
					}
				}
			}

			f = 1.0 / n;

			for(j = 1; j <= n; j++)
				f = max(f, dp[j]);

			ansx += f;

			for(j = 1; j <= n; j++){
				if(visited[j] == 0)
					continue;

				p[j] = 0;

				for(k = 1; k <= n; k++){
					z = d[j][k];
					s[k][z] = 0;
				}

				visited[j] = 0;
			}

			for(j = 1; j <= n; j++)
				dp[j] = 0;
		}

		ans = max(ans, ansx);
	}

	ans += (1.0 / n);

	printf("%.15lf\n", ans);

	return 0;
}

#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <queue>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <bitset>

using namespace std;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define epr(...) fprintf(stderr, __VA_ARGS__)
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")\n"
#define all(a) (a).begin(), (a).end()

#define equal equalll
#define less lesss
const int N = 444;
const long long INF = 1e9 + 19;

int n, m;
int a[N][N];
vector < int > e[N];
double cof[N];
int use[N];
int tmr;
//double sum[N];
double mx[N];

void read() {
	scanf("%d%d", &n, &m);
	memset(a, 63, sizeof(a));
	for (int i = 0; i < m; i++) {
		int v, u;
		scanf("%d%d", &v, &u); v--; u--;
		e[v].pb(u);
		e[u].pb(v);
		a[v][u] = a[u][v] = 1;
	}
}

void solve() {
	for (int i = 0; i < n; i++)
		a[i][i] = 0;
	for (int k = 0; k < n; k++)
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				a[i][j] = min(a[i][j], a[i][k] + a[k][j]);

	//for (int i = 0; i < n; i++, cerr << endl)
		//for (int j = 0; j < n; j++)
			//cerr << a[i][j] << " ";

	double answer = 0;

	for (int f = 0; f < n; f++) {
		vector < vector < int > > g(n);
		for (int i = 0; i < n; i++)
			g[a[f][i]].pb(i);

		double res = 0;
		for (int d = 0; d < n; d++) {
			if (g[d].empty()) continue;
			if (g[d].size() == 1) {
				res += 1.0 / n;
				continue;
			}
			double best2 = 1.0 / n;

			for (int i = 0; i < n; i++)
				cof[i] = 0;
			tmr++;
			for (auto v: g[d]) {
				for (auto u: e[v]) {
					cof[u] += 1.0 / n / e[v].size();
					use[u] = tmr;
				}
			}
			vector < int > who;
			for (int i = 0; i < n; i++)
				if (use[i] == tmr)
					who.pb(i);

			for (int s = 0; s < n; s++) {
				double res2 = 0;
				tmr++;
				for (auto v: who) {
					int d = a[s][v];
					if (use[d] != tmr) {
						use[d] = tmr;
						//sum[d] = 0;
						mx[d] = 0;
					}
					//sum[d] += cof[v];
					mx[d] = max(mx[d], cof[v]);
				}
				tmr++;
				for (auto v: who) {
					int d = a[s][v];
					if (use[d] != tmr) {
						use[d] = tmr;
						//assert(sum[d] > 0);
						res2 += mx[d];
					}
				}
				best2 = max(best2, res2);
			}
			res += best2;
		}

		answer = max(answer, res);

	}

	printf("%.17f\n", answer);

}

void stress() {

}

int main(){
#ifdef MY_DEBUG
    freopen("in", "r", stdin);
    //freopen("out", "w", stdout);
#endif
    if (1) {
        int k = 1;
        for (int tt = 0; tt < k; tt++) {
            read();
            solve();
        }
    }
    else {
        stress();
    }

    return 0;
}

#include<bits/stdc++.h>
#define F first
#define S second
#define pii pair<int,int>
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 417 , INF = 1e9;
vector<int> adj[N] , t[N][N];
int n , m , dis[N][N];
ld p[N] , C;
pair<ld , int> mx[N];
bool mark[N];
vector<int> g;

void Floyd(){
    for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(i != j)dis[i][j] = INF;
    for(int i=1;i<=n;i++){
        for(auto j : adj[i])dis[i][j] = 1;
    }
    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)dis[i][j] = min(dis[i][j] , dis[i][k] + dis[k][j]);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)t[i][dis[i][j]].pb(j);
    return ;
}

ld get_ans(int v){
    ld answer = 0;
    for(int d=0;d<n;d++){
        memset(p , 0 , sizeof p);
        memset(mark , 0 , sizeof mark);
        g.clear();
        for(auto u : t[v][d]){
            for(auto k : adj[u]){
                if(!mark[k])g.pb(k);
                mark[k] = true;
                p[k] += C / (ld)adj[u].size();
            }
        }
        if(g.size() == 0)continue;
        ld ret = C;
        for(int r=0;r<n;r++)mx[r] = {0 , 0};
        for(int u=1;u<=n;u++){
            ld q = 0;
            for(auto k : g){
                int D = dis[u][k];
                if(mx[D].S == u)q -= mx[D].F;
                if(mx[D].S != u || mx[D].F <= p[k])mx[D] = {p[k] , u};
                q += mx[D].F;
            }
            ret = max(ret , q);
        }
        answer += ret;
    }
    return answer;
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> n >> m;
    for(int i=0;i<m;i++){
        int u , v; cin >> u >> v;
        adj[u].pb(v); adj[v].pb(u);
    }
    Floyd(); C = (ld)(1.0) / n;
   // cout << C << endl;
    ld ans = 0;
    for(int i=1;i<=n;i++){
        ans = max(ans , get_ans(i));
    }
    cout << fixed << setprecision(20) << ans << '\n';
}

#include <cstdio>
template <typename T> inline void tension(T &a, const T &b){if (a>b) a=b;}
template <typename T> inline void relax(T &a, const T &b){if (a<b) a=b;}
inline unsigned int getuint(){
	char w=getchar();
	while (w<'0'||'9'<w) w=getchar();
	unsigned int ans=0;
	for (;'0'<=w&&w<='9';w=getchar()) ans=ans*10+w-'0';
	return ans;
}
const int MAXV=405, MAXE=MAXV*MAXV;
struct Edge{int t, next;} G[MAXE];int head[MAXV], e=1;
int deg[MAXV];
int dist[MAXV][MAXV];
int main(){
	//freopen("ex.in", "r", stdin);
	int n=getuint(), m=getuint();
	for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) dist[i][j]=i!=j?0x3f3f3f3f:0;
	for (int i=1;i<=m;i++){
		int x=getuint(), y=getuint();
		deg[x]++, deg[y]++;
		G[++e].t=y, G[e].next=head[x], head[x]=e;
		G[++e].t=x, G[e].next=head[y], head[y]=e;
		dist[x][y]=dist[y][x]=1;
	}
	for (int k=1;k<=n;k++) for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) tension(dist[i][j], dist[i][k]+dist[k][j]);
	double ans=0;
	for (int s=1;s<=n;s++){
		double now=0;
		for (int d=0;d<=n;d++){
			static int a[MAXV], cnt[MAXV];int m=0;
			for (int i=1;i<=n;i++) if (dist[s][i]==d) a[++m]=i;
			if (!m) continue;
			double sum=1.0;
			static double c[MAXV];
			for (int i=1;i<=n;i++) c[i]=0;
			for (int x, l=1;l<=m;l++) for (int i=head[x=a[l]];i;i=G[i].next) c[G[i].t]+=1.0/deg[x], cnt[G[i].t]++;
			m=0;for (int i=1;i<=n;i++) if (cnt[i]) a[++m]=i, cnt[i]=0;
			for (int t=1;t<=n;t++){
				static double maxv[MAXV];
				for (int i=1;i<=m;i++) relax(maxv[dist[t][a[i]]], c[a[i]]);
				double tmp=0;
				for (int i=1;i<=m;i++) tmp+=maxv[dist[t][a[i]]], maxv[dist[t][a[i]]]=0;
				relax(sum, tmp);
			}
			now+=sum;
		}
		relax(ans, now/n);
	}
	printf("%.12f\n", ans);
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<iostream>
#include<bitset>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<algorithm>
#include<limits.h>
#include<stdlib.h>
#include<time.h>
#define ll int
#define maxn 510
#define For(i,x,y) for(ll i=x;i<=y;i++)
#define FOr(i,x,y) for(ll i=x;i>=y;i--)
using namespace std;
inline int read(){int x=0,f=0;char ch=getchar();for(;ch<'0'||ch>'9';ch=getchar()) if(ch=='-') f=1;for(;ch>='0'&&ch<='9';ch=getchar()) x=(x<<1)+(x<<3)+ch-48;return f?-x:x;}
inline void write(ll x){if(x<10) putchar(x+48);else write(x/10),putchar(x%10+48);}
inline void writeln(ll x){if(x<0) x=-x,putchar('-');write(x);putchar('\n');}
ll q[maxn],dis[maxn][maxn],n,m;
double c[maxn],v[maxn],ans;
int main(){
	n=read();	m=read();
	For(i,1,n)	For(j,1,n)	dis[i][j]=i==j?0:n+1;
	For(i,1,m){
		ll a=read(),b=read();
		dis[a][b]=dis[b][a]=1;
	}
	For(k,1,n)	For(i,1,n)	For(j,1,n)	dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	For(i,1,n){
		double now=0;
		For(j,0,n-1){
			memset(v,0,sizeof v);	double s=0;	ll u=0,tot=0;
			For(k,1,n)	if (dis[i][k]==j){
				ll sz=0;	u++;
				For(l,1,n)	sz+=dis[k][l]==1;
				For(l,1,n)	if (dis[k][l]==1)	v[l]+=1.0/sz;
			}
			For(k,1,n)	if (abs(dis[i][k]-j)<2)	q[++tot]=k;
			For(k,1,n){
				double w=0;
				For(l,1,tot)	c[dis[k][q[l]]]=max(c[dis[k][q[l]]],v[q[l]]);
				For(l,1,tot)	w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				s=max(s,w);
			}
			if (u)	s=max(s,1.0);	now+=s/n;
		}ans=max(ans,now);
	}printf("%.10lf",ans);
}
/*
3 3
1 2
1 3
2 3
*/

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define maxn 405
#define maxm (maxn * maxn)
#define mem(a,b) memset(a,b,sizeof(a))
#define db double
#define pb(a) push_back(a)
using namespace std;

int f[maxn][maxn];

int head[maxn],t[maxm * 2],next[maxm * 2],sum;

int din[maxn];

int n,m;

db ans;

void insert(int x,int y){
	t[++sum]=y;
	next[sum]=head[x];
	head[x]=sum;
}

db p[maxn],dis[maxn];

vector<int> th;

bool bz[maxn];

db calc(int now){
	db ret=0;
	fo(i,0,n) {
		//mem(p,0);
		th.clear();
		db today=1.0/n,nd=0;//(1 / size * (size / n)
		fo(j,1,n) {
			if (f[now][j]!=i) continue;
			for(int tmp=head[j];tmp;tmp=next[tmp]) {
				if (p[t[tmp]]==0) th.pb(t[tmp]);
				p[t[tmp]]+=1.0 / n / din[j];
			}
		}
		if (th.size()==0) continue;
		fo(tomo,1,n) {
			mem(dis,0);
			mem(bz,0);
			fo(j,0,th.size()-1) {
				int x=th[j];
				dis[f[tomo][x]]=max(dis[f[tomo][x]],p[x]);
			}
			db tmp=0;
			fo(j,0,th.size()-1) {
				int x=th[j];
				if (bz[f[tomo][x]]) continue;
				tmp=tmp+dis[f[tomo][x]];
				bz[f[tomo][x]]=1;
			}
			nd=max(nd,tmp);
		}
		ret+=max(today,nd);
		fo(j,0,th.size()-1) p[th[j]]=0;
	}
	return ret;
}

int main(){
	mem(f,63);
	scanf("%d%d",&n,&m);
	fo(i,1,n) f[i][i]=0;
	fo(i,1,m) {
		int x,y;
		scanf("%d%d",&x,&y);
		din[x]++;
		din[y]++;
		insert(x,y);
		insert(y,x);
		f[x][y]=f[y][x]=1;
	}
	fo(k,1,n)
		fo(i,1,n)
			fo(j,1,n) f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	fo(i,1,n) {
		db now=calc(i);
		ans=max(ans,now);
	}
	printf("%.8lf",ans);
	return 0;
}

#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define N 410
using namespace std;
typedef double f32;
const f32 eps=1e-7;
int n,m,dis[N][N],disnum[N],ind[N];
vector<int>v[N][N];
inline void floyd()
{
	int i,j,k;
	for(k=1;k<=n;++k)
		for(i=1;i<=n;++i)
			for(j=1;j<=n;++j)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for(i=1;i<=n;++i)
		for(j=1;j<=n;++j)
		{
			if(!v[i][dis[i][j]].size())disnum[i]++;
			v[i][dis[i][j]].push_back(j);
		}
}
f32 ans,p[N],maxp[N];
int maybe[N],vis[N],tim,cnt;
int main()
{
	cin>>n>>m;
	int i,j,x,y;
	memset(dis,0x3f,sizeof dis);
	for(i=1;i<=n;++i)dis[i][i]=0;
	for(i=1;i<=m;++i)
	{
		scanf("%d%d",&x,&y);
		if(dis[x][y]==1)continue;
		ind[x]++,ind[y]++;
		dis[x][y]=dis[y][x]=1;
	}
	floyd();
	int a,b,da;
	f32 sum,maxx,tmp;
	for(a=1;a<=n;++a)
	{
		sum=0;
		for(da=0;da<n;++da)if(v[a][da].size())
		{
/*			if(v[a][da].size()==1)
			{
				sum+=1.0/n;
				continue;
			}*/
			memset(p,0,sizeof p);
			cnt=0;
			//预处理第二天在每个点出现的概率
			for(i=0;i<v[a][da].size();++i)
			{
				x=v[a][da][i];
				for(j=0;j<v[x][1].size();++j)
				{
					y=v[x][1][j];
					if(p[y]<eps)maybe[++cnt]=y;
					p[y]+=1.0/(v[a][da].size()*ind[x]);
				}
			}
			//枚举第二天在哪个点侦查,最后取一个最大值
			maxx=0;
			for(b=1;b<=n;++b)
			{
				tmp=0,tim++;//时间戳,和vis数组用来记录本次距离b为i的点是否出现
				for(j=1;j<=cnt;++j)
				{
					x=maybe[j];
					if(vis[dis[b][x]]!=tim)maxp[dis[b][x]]=0;
					if(maxp[dis[b][x]]<p[x])
					{
						tmp-=maxp[dis[b][x]],tmp+=p[x];
						maxp[dis[b][x]]=p[x];
					}
					vis[dis[b][x]]=tim;
				}
				maxx=max(maxx,tmp);//枚举b点选谁,取最大值
			}
			sum+=max(maxx*v[a][da].size()/n,1.0/n);
		}
		ans=max(ans,sum);
	}
	printf("%.100lf",ans);
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

const int limite=405;

void maximiza(double &a,double b)
{
  a=max(a,b);
}

int n,m;
vector<int> g[limite];
int dist[limite][limite];
double prob[limite];
int nlistav;
int listav[limite];
double dist2prob[limite];

int main()
{
  cout.setf(ios::fixed);
  cout.precision(10);
  cin>>n>>m;
  for (int i=1;i<=n;i++)
    for (int j=1;j<=n;j++)
      if (i!=j)
	dist[i][j]=limite;
  for (int i=0;i<m;i++) {
    int u,v;
    cin>>u>>v;
    g[u].push_back(v);
    g[v].push_back(u);
    dist[u][v]=dist[v][u]=1;
  }
  for (int k=1;k<=n;k++)
    for (int i=1;i<=n;i++)
      for (int j=1;j<=n;j++)
	dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
  double maxc1=0;
  for (int c1=1;c1<=n;c1++) {
    double sumd1=0;
    for (int d1=0;d1<=n-1;d1++) {
      for (int v=1;v<=n;v++)
	prob[v]=0;
      double maxu1=0;
      for (int u=1;u<=n;u++) {
	if (dist[c1][u]==d1) {
	  maxu1=1.0/n;
	  vector<int> &ar=g[u];
	  int aridad=int(ar.size());
	  for (int i=0;i<aridad;i++) {
	    int v=ar[i];
	    prob[v]+=1.0/n/aridad;
	  }
	}
      }
      nlistav=0;
      for (int v=1;v<=n;v++)
	if (prob[v]>0)
	  listav[nlistav++]=v;
      double maxc2=0;
      for (int c2=1;c2<=n;c2++) {
	double sumd2=0;
	for (int i=0;i<nlistav;i++) {
	  int v=listav[i];
	  int d2=dist[c2][v];
	  double &dp=dist2prob[d2];
	  sumd2-=dp;
	  maximiza(dp,prob[v]);
	  sumd2+=dp;
	}
	for (int i=0;i<nlistav;i++) {
	  int v=listav[i];
	  int d2=dist[c2][v];
	  dist2prob[d2]=0;
	}
	maximiza(maxc2,sumd2);
      }
      sumd1+=max(maxu1,maxc2);
    }
    maximiza(maxc1,sumd1);
  }
  cout<<maxc1<<endl;
}

#include <iostream>
#include <vector>

using namespace std;

const int MAXN = 405;
const double EPS = 1e-9;
int d[MAXN][MAXN];
double pr[MAXN];
vector<int> g[MAXN], v[MAXN];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(12);
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            d[i][j] = (i == j? 0 : MAXN);
    for(int i = 0; i < m; i++) {
        int v, u;
        cin >> v >> u;
        v--;
        u--;
        g[v].push_back(u);
        g[u].push_back(v);
        d[v][u] = 1;
        d[u][v] = 1;
    }
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < n; k++)
                d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
    double ans = 0;
    for(int s = 0; s < n; s++) {
        int maxd = 0;
        for(int i = 0; i < n; i++) {
            v[d[s][i]].push_back(i);
            maxd = max(maxd, d[s][i]);
        }
        double cur = 0;
        for(int dd = 0; dd <= maxd; dd++) {
            for(size_t i = 0; i < v[dd].size(); i++) {
                int vv = v[dd][i];
                for(size_t j = 0; j < g[vv].size(); j++)
                    pr[g[vv][j]] += 1. / g[vv].size();
            }
            vector< pair<int, double> > u;
            for(int i = 0; i < n; i++) {
                if(pr[i] > EPS)
                    u.push_back(make_pair(i, pr[i]));
                pr[i] = 0;
            }
            double x = 1;
            for(int t = 0; t < n; t++) {
                for(size_t i = 0; i < u.size(); i++)
                    if(u[i].second > pr[d[t][u[i].first]])
                        pr[d[t][u[i].first]] = u[i].second;
                double y = 0;
                for(size_t i = 0; i < u.size(); i++) {
                    y += pr[d[t][u[i].first]];
                    pr[d[t][u[i].first]] = 0;
                }
                x = max(x, y);
            }
            cur += x / n;
        }
        for(int i = 0; i <= maxd; i++)
            v[i].clear();
        ans = max(ans, cur);
    }
    cout << ans << '\n';
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define db double
#define pb push_back
const int N=405;
const int inf=1e9+7;
int dist[N][N];
db pro[N],dmx[N];
bool in[N];
vector<int> E[N];
void AddEdge(int u, int v){ E[u].pb(v);E[v].pb(u);dist[u][v]=dist[v][u]=1;}
int main()
{
	int n,m,i,j,k,u,v,d1,d2;
	scanf("%i %i",&n,&m);
	for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(i!=j) dist[i][j]=inf;
	for(i=1;i<=m;i++) scanf("%i %i",&u,&v),AddEdge(u,v);
	for(k=1;k<=n;k++) for(i=1;i<=n;i++) for(j=1;j<=n;j++) dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
    db sol=0;
    for(u=1;u<=n;u++)
	{
		db ans=0;
		for(d1=0;d1<=n;d1++)
		{
			for(i=1;i<=n;i++) pro[i]=0,in[i]=0;
			vector<int> all;
			for(i=1;i<=n;i++) if(dist[u][i]==d1)
			{
				if(!in[i]) all.pb(i),in[i]=1;
				for(j:E[i])
				{
					if(!in[j]) all.pb(j),in[j]=1;
					pro[j]+=(db)1.0/n/E[i].size();
				}
			}
			if(all.empty()) continue;
			db mx=(db)1.0/n;
			for(v=1;v<=n;v++)
			{
				db tmp=0;
				for(i:all) dmx[dist[v][i]]=max(dmx[dist[v][i]],pro[i]);
				for(i:all) tmp+=dmx[dist[v][i]],dmx[dist[v][i]]=0;
				mx=max(mx,tmp);
			}
			ans+=mx;
		}
		sol=max(sol,ans);
	}
	cout << fixed << setprecision(12) << sol;
	return 0;
}

#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<unordered_map>
using namespace std;

const int MAXN = 400;

int path[MAXN + 5][MAXN + 5];
vector<int> G[MAXN + 5];
int n,m;

//double chooseBCD2(const unordered_map<int, double>& p) {
//    double ret = 0;
//    for (int u = 0; u < n; u ++) {
//        unordered_map<int, double> bestProbAtLen;
//        for (auto it : p) {
//            bestProbAtLen[path[u][it.first]] = max(it.second, bestProbAtLen[path[u][it.first]]);
//        }
//        double sum = 0;
//        for (auto it : bestProbAtLen)
//            sum += it.second;
//        ret = max(ret, sum);
//    }
//    return ret;
//}

double best[MAXN + 5];

double chooseBCD2(const unordered_map<int, double>& p) {
    double ret = 0;
    for (int u = 0; u < n; u ++) {
        double sum = 0;
        for (auto it : p) {
            sum -= best[path[u][it.first]];
            best[path[u][it.first]] = max(it.second, best[path[u][it.first]]);
            sum += best[path[u][it.first]];
        }
        ret = max(ret, sum);
        for (auto it : p)
            best[path[u][it.first]] = 0;
    }
    return ret;
}

double firstBCD(int source) {
    vector<vector<int>> nodes(n);
    for (int u = 0; u < n; u ++)
        nodes[path[source][u]].push_back(u);
    double ret = 0;
    for (int l = 0; l < n; l++) {
        if (nodes[l].empty()) continue;
        unordered_map<int, double> p;
        for (int u : nodes[l]) {
            for (int v : G[u])
                p[v] += (1.0 / nodes[l].size()) * (1.0 / G[u].size());
        }
//        printf("%d : %d\n",l, nodes[l].size());
        ret += (1.0 * nodes[l].size() / n) * max(chooseBCD2(p), 1.0 / nodes[l].size());
    }
    return ret;
}

void warshal() {
    memset(path, 1, sizeof path);
    for (int u = 0; u < n; u++)
        for (int v : G[u])
            path[u][v] = 1;
    for (int i = 0; i < n; i++) path[i][i] = 0;
    for (int k = 0; k < n; k++)
        for (int u = 0; u < n; u++)
            for (int v = 0; v < n; v++)
                path[u][v] = min(path[u][v], path[u][k] + path[k][v]);
}

int main() {
//    freopen("chase.in","r",stdin);
    int c,c2;
    scanf("%d%d",&n,&m);
    for (c=0;c<m;c++) {
        int u,v;
        scanf("%d%d",&u,&v);
        u--;--v;
        G[u].push_back(v);
        G[v].push_back(u);
    }
    warshal();
    double ret = 0;
    for (int i = 0; i < n; i++) {
//        printf("%d: \n", i + 1);
        ret = max(ret, firstBCD(i));
    }
    printf("%.9f\n",ret);
    return 0;
}

#include<bits/stdc++.h>
#define ll int
#define pb push_back
#define mp make_pair
#define ld long double
#define F first
#define S second
#define pii pair<ll,ll>

using namespace :: std;

const ll maxn=409;
const ll inf=1e9+500;

vector<ll> ger[maxn];
ll d[maxn][maxn];
ll n;
ld p[maxn];

ld ma[maxn];
ld W(const vector<ll> &vec,ll x){
    for(auto v:vec){
        ma[d[x][v]]=max(ma[d[x][v]],p[v]);
    }
    ld ans=0;
    for(auto v:vec){
        ans+=ma[d[x][v]];
        ma[d[x][v]]=0;
    }
    return ans;
}
ld Q(){
    vector<ll> vec;
    for(ll i=0;i<n;i++){
        if(p[i]>0){
            vec.pb(i);
        }
    }
    ld ans=0;
    for(ll i=0;i<n;i++){
        ans=max(ans,W(vec,i));
    }
    return ans;
}
ld g(const vector<ll> &ve){
    if(ve.size()==0){
        return 1;
    }
    else{
        fill(p,p+maxn,0);
        ld B=((ld)1/(ld)ve.size());
        for(auto v:ve){
            ld D=(B/(ld)ger[v].size());
            for(auto u:ger[v]){
                p[u]+=D;
            }
        }
        return max((ld)1/(ld)(ve.size()),Q());
    }
}

vector<ll> vec[maxn];
ld R(ll a){
    for(ll i=0;i<n;i++){
        vec[i].clear();
    }
    for(ll i=0;i<n;i++){
        vec[d[a][i]].pb(i);
    }
    ld ans=0;
    for(ll i=0;i<n;i++){
        ans+=((ld)vec[i].size()/(ld)n)*g(vec[i]);
    }
    return ans;
}

void bfs(ll a){
    for(ll i=0;i<n;i++){
        d[a][i]=inf;
    }
    queue<pii> qu;
    qu.push(mp(a,0));
    while(qu.size()){
        pii e=qu.front();
        qu.pop();
        if(d[a][e.F]==inf){
            d[a][e.F]=e.S;
            for(auto v:ger[e.F]){
                qu.push(mp(v,e.S+1));
            }
        }
    }
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    ll m;
    cin>>n>>m;
    for(ll i=0;i<m;i++){
        ll v,u;
        cin>>v>>u;
        v--;
        u--;
        ger[u].pb(v);
        ger[v].pb(u);
    }
    for(ll i=0;i<n;i++){
        bfs(i);
    }
    ld ans=0;
    for(ll i=0;i<n;i++){
        ans=max(ans,R(i));
    }
    cout<<fixed<<setprecision(10)<<ans;
}

#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int maxn = 405;
int d[maxn][maxn],n,m;
double dis[maxn];
double posi[maxn];
vector<int> E[maxn];
vector<int> f;
void TAT()
{
    memset(d,127,sizeof(127));
}
double next(int p,int di)
{
    double ans = 0;
    memset(posi,0,sizeof(posi));

    for(int i=1;i<=n;i++)
        if(d[p][i]==di)
            for(auto v:E[i])
                posi[v]+=1./n/E[i].size();

    f.clear();

    for(int i=1;i<=n;i++)
        if(posi[i]>eps)
            f.push_back(i);

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(auto v:f)
            dis[d[i][v]]=max(dis[d[i][v]],posi[v]);
        for(auto v:f)
        {
            tmp+=dis[d[i][v]];
            dis[d[i][v]]=0;
        }
        ans=max(ans,tmp);
    }
    return ans;
}
void QAQ()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if(i!=j)d[i][j]=n+1;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        d[a][b]=1;
        d[b][a]=1;
        E[a].push_back(b);
        E[b].push_back(a);
    }

    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);

    double ans = 0;

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(int di=0;di<n;di++)
        {
            int cnt = 0;
            for(int j=1;j<=n;j++)if(d[i][j]==di)cnt++;
            if(cnt==0)continue;
            double day1 = 1./n;
            double day2 = next(i,di);
            tmp+=max(day1,day2);
        }
        ans=max(ans,tmp);
    }
    printf("%.12f\n",ans);
}
int main()
{
    TAT();
    QAQ();
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <cassert>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <time.h>
using namespace std;

#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979
#define x0 ikjnrmthklmnt
#define y0 lkrjhkltr
#define y1 ewrgrg

typedef long long Int;
typedef unsigned long long UInt;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<Int, Int> PLL;
typedef pair<double, double> PDD;

const int INF = 1000000000;
const int BASE = 1000000007;
const int MAX = 507;
const int MAX2 = 10007;
const int MAXE = 100000;
const int ADD = 1000000;
const int MOD = 1000000007;
const int CNT = 0;

int d[MAX][MAX];

vector<PII> C[MAX];

double p2[MAX];

int deg[MAX];

pair<int, double> A[MAX];

int To[MAX];

int main()
{
	//freopen("in.txt" , "r" , stdin);

	int n , m;
	cin >> n >> m;

	//n = 400;

	FOR(i,0,n)
	{
		FOR(j,0,n)
		{
			d[i][j] = INF;
		}
		d[i][i] = 0;
	}

	FOR(i,0,m)
	{
		int a , b;
		scanf("%d %d" , &a , &b);
		--a; --b;
		d[a][b] = d[b][a] = 1;
		deg[a] ++ ;
		deg[b] ++ ;
	}
	/*FOR(i,0,n)
	{
		FOR(j,i - 1, i + 2)
		{
			if (j < 0 || j >= n) continue;
			if (i == j)
				continue;
			d[i][j] = 1;
			++ deg[i];
		}
	}*/

	FOR(k,0,n)
	{
		FOR(i,0,n)
		{
			FOR(j,0,n)
			{
				d[i][j] = min(d[i][j] , d[i][k] + d[k][j]);
			}
		}
	}

	FOR(i,0,n)
	{
		FOR(j,0,n)
		{
			C[i].push_back(MP(d[i][j] , j));
		}
		sort(ALL(C[i]));
	}

	double res = 0;

	FOR(i,0,n)
	{
		int ptr = 0;
		double P = 0;
		while (ptr < n)
		{
			int add = 1;
			while (ptr + add < n && C[i][ptr + add].first == C[i][ptr].first) ++add;

			double pp = 1.0 / n;
			FILL(p2, 0);

			FOR(j,ptr , ptr + add)
			{
				int v = C[i][j].second;
				FOR(k,0,n)
				{
					if (d[v][k] == 1)
					{
						p2[k] += 1.0 / n / deg[v];
					}
				}
			}

			int szTo = 0;
			double sum = 0;
			FOR(j,0,n)
			{
				if (p2[j] > 1e-6)
				{
					To[szTo ++] = (j);
					sum += p2[j];
				}
			}

			FOR(j,0,n)
			{
				int szA = 0;
				double cur = 0;
				FOR(k,0,szTo)
				{
					int to = To[k];
					A[szA ++] = (MP(d[j][to] , p2[to]));
				}

				sort(A , A + szA);

				int ptr2 = 0;
				while (ptr2 < szA)
				{
					int add2 = 1;
					while (ptr2 + add2 < szA && A[ptr2].first == A[ptr2 + add2].first) ++ add2;
					cur += A[ptr2 + add2 - 1].second;
					ptr2 += add2;
				}

				pp = max(pp , cur);
			}

			//cout << ptr << ' ' << pp << endl;

			P += pp;
			ptr += add;
		}
		//cout << endl;
		res = max(res , P);

	}

	printf("%.10f\n" , res);

	//cout << 1.0 * clock() / CLOCKS_PER_SEC << endl;

    return 0;
}

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 405
int n,m,now;
int map[N][N],pa[N*N],pb[N*N],in1[N],b[N],vis[N][N];
double s0[N][N],s1[N][N],s2[N][N],p[N][N],a[N],tmp,ans;
vector<int>v[N];
vector<int>::iterator it;
void update(int a,int b,double x)
{
	if(a<0)return;
	if(vis[a][b]!=now)vis[a][b]=now,p[a][b]=0,v[a].push_back(b);
	p[a][b]=max(p[a][b],x);
}
int main()
{
	// freopen("leidilu.in","r",stdin);
	// freopen("leidilu.out","w",stdout);
	scanf("%d%d",&n,&m);memset(map,0x3f,sizeof(map));for(int i=1;i<=n;i++)map[i][i]=0;
	for(int i=1,x,y;i<=m;i++)scanf("%d%d",&x,&y),pa[i]=x,pb[i]=y,in1[x]++,in1[y]++,map[x][y]=map[y][x]=1;
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				map[i][j]=min(map[i][j],map[i][k]+map[k][j]);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		{
			int x=pa[j],y=pb[j];
			if(map[i][y]==map[i][x]+1)
				s1[i][x]+=1.0/n/in1[y],s2[i][y]+=1.0/n/in1[x];
			else if(map[i][y]==map[i][x]-1)
				s1[i][y]+=1.0/n/in1[x],s2[i][x]+=1.0/n/in1[y];
			else
				s0[i][y]+=1.0/n/in1[x],s0[i][x]+=1.0/n/in1[y];
		}
	for(int i=1;i<=n;i++)
	{
		memset(b,0,sizeof(b));memset(a,0,sizeof(a));
		for(int j=1;j<=n;j++)b[map[i][j]]++;
		for(int j=0;j<n;j++)if(b[j])a[j]=1.0/n;
		for(int j=1;j<=n;j++)
		{
			now++;
			for(int k=1;k<=n;k++)
			{
				update(map[i][k],map[j][k],s0[i][k]);
				update(map[i][k]+1,map[j][k],s1[i][k]);
				update(map[i][k]-1,map[j][k],s2[i][k]);
			}
			for(int k=0;k<=n;k++)
			{
				tmp=0;
				for(it=v[k].begin();it!=v[k].end();it++)tmp+=p[k][*it];
				v[k].clear();a[k]=max(tmp,a[k]);
			}
		}tmp=0;
		for(int j=0;j<=n;j++)tmp+=a[j];ans=max(ans,tmp);
	}printf("%.12lf\n",ans);
}

#include <bits/stdc++.h>
using namespace std;

const int MAX = 500;

vector<int> edge[MAX];
int G[MAX][MAX];
int cnt_nxt[MAX];
double p_nxt[MAX], p_dist[MAX];
bool vis[MAX];

int n, m;

double solve(int g1, int dist1) {
    double rst = 0;
    for (int i = 1; i <= n; i++) {
        p_nxt[i] = 0;
        vis[i] = false;
    }
    vector<int> city;
    for (int v = 1; v <= n; v++) {
        if (G[g1][v] != dist1) continue;
        for (auto b : edge[v]) {
            p_nxt[b] += 1.0 / n / edge[v].size();
            if (!vis[b]) vis[b] = true, city.push_back(b);
        }
    }
    for (int g2 = 1; g2 <= n; g2++) {
        double tmp = 0;
        for (auto b : city) p_dist[G[g2][b]] = max(p_dist[G[g2][b]], p_nxt[b]);
        for (auto b : city) {
            tmp += p_dist[G[g2][b]];
            p_dist[G[g2][b]] = 0;
        }
        rst = max(rst, tmp);
    }
    return rst;
}

int main() {
    scanf("%d %d", &n, &m);

    memset(G, 0x3f, sizeof(G));
    for (int i = 1; i <= n; i++) G[i][i] = 0;

    for (int i = 1; i <= m; i++) {
        int u, v;
        scanf("%d %d", &u, &v);
        edge[u].push_back(v);
        edge[v].push_back(u);
        G[u][v] = G[v][u] = 1;
    }

    for (int b = 1; b <= n; b++) {
        for (int a = 1; a <= n; a++) {
            for (int c = 1; c <= n; c++) {
                G[a][c] = min(G[a][c], G[a][b] + G[b][c]);
            }
        }
    }

    double ans = 0;
    for (int g1 = 1; g1 <= n; g1++) {
        double tans = 0;
        for (int dist1 = 0; dist1 <= n; dist1++) {
            int cnt_city = 0;
            for (int i = 1; i <= n; i++) if (G[g1][i] == dist1) cnt_city++;
            if (!cnt_city) continue;
            tans += max(1.0 / n, solve(g1, dist1));
        }
        ans = max(tans, ans);
    }

    printf("%.12f\n", ans);
}

#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, m; cin >> n >> m;

	int INF = int(1e9 + 7);
	int dist[n][n];
	memset(dist, INF, sizeof(dist));

	vector<int> adj[n];
	for (int j = 0; j < m; j++) {
		int a, b; cin >> a >> b; a--; b--;
		dist[a][b] = dist[b][a] = 1;
		adj[a].push_back(b); adj[b].push_back(a);
	}

	for (int i = 0; i < n; i++)
		dist[i][i] = 0;

	for (int k = 0; k < n; k++)
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				if (dist[i][k] < INF && dist[j][k] < INF)
					dist[i][j] = min(dist[i][j], dist[i][k] + dist[j][k]);

	long double ans = 0;

	long double max_day[n]; for (int k = 0; k < n; k++) max_day[k] = 0;

	for (int i = 0; i < n; i++) {
		vector<vector<int> > groups(n);
		for (int j = 0; j < n; j++)
			groups[dist[i][j]].push_back(j);

		long double cchance = 0;

		long double distr[n];

		for (int d = 0; d < n; d++) {
			vector<int> group = groups[d];
			if (!group.size()) continue;

			// perform day 1 guess
			long double chance = 1.00 / group.size();

			// perform day 2 guess

			vector<int> interesting;
			for (int k = 0; k < n; k++) distr[k] = 0;

			for (int k : group) for (int j : adj[k]) {
				if (distr[j] == 0) interesting.push_back(j);
				distr[j] += 1.00 / group.size() / adj[k].size();
			}

			for (int j = 0; j < n; j++) {
				long double chancej = 0;

				for (int k : interesting)
					max_day[dist[j][k]] = max(max_day[dist[j][k]], distr[k]);
				for (int k : interesting) {
					chancej += max_day[dist[j][k]];
					max_day[dist[j][k]] = 0;
				}

				chance = max(chance, chancej);
			}
			cchance += chance * group.size() / n;
		}

		ans = max(ans, cchance);
	}

	cout << ans << endl;

	return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#define rank krevedka
#define left trulala
#define rigth trulalo
#define ran rank
using namespace std;

int d[450][450];
vector<int> e[500];
vector<int> z[500];
double a[450];
//double p[450];
double q[450];
const double eps = 1e-9;
int n;
double check(vector<int>&qv)
{
    vector<int> qn;
    for(int i=0;i<n;i++)
        a[i]  = q[i] = 0;
    int tot = 0;
    for(int i=0;i<qv.size();i++)
    {
        int u = qv[i];
        //tot+=e[u].size();
        tot++;
        double p = 1.0/e[u].size();
        for(int j=0;j<e[u].size();j++)
        {
            int v =  e[u][j];
            if(a[v]<eps) qn.push_back(v);
            a[v]+=p;
        }
    }
    double res= 0;
    for(int second = 0;second<n;second++)
    {
        //vector<int> temp;
        //for(int i=0;i<n;i++)q[i] = 0;
            //p[i] = q[i] = 0;
        int d1 = 1e9;
        int d2 = -1e9;
        for(int i=0;i<qn.size();i++)
        {
            int  u = qn[i];
            int dist = d[second][u];
            if(dist<d1) d1 = dist;
            if(dist>d2) d2 = dist;
            //if(q[dist]<eps) temp.push_back(dist);
            //p[ dist ]+=a[i];
            if(q[dist]<a[u]) q[dist] = a[u];
        }
        double s = 0;
        for(int i=d1;i<=d2;i++)
        {
            s += q[ i ];
            q[i] = 0;
        }
        //s += double(q[i])/tot;
        s/=tot;
        //if(a[i]) s = max(s, double(a[i])/p[ d[second][i] ] );
        if(s>res) res = s;
    }
    return res;
}

int main()
{
    int m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
        d[i][j] = 1e5;
    for(int i=0;i<n;i++)
        d[i][i] = 0;
    list<pair<int,int> > sp;
    for(int i=0;i<m;i++)
    {
        int u,v;
        scanf("%d%d",&u,&v);
        u--;v--;
        e[u].push_back(v);
        e[v].push_back(u);
        d[u][v] = d[v][u] = 1;
        sp.push_back(make_pair(u,v));
    }
    while(sp.begin()!=sp.end())
    {
        int u = sp.front().first;
        int v = sp.front().second;
        sp.pop_front();
        for(int q=0;q<2;q++)
        {
            for(int i=0;i<e[v].size();i++)
            {
                int z = e[v][i];
                if(d[u][z]>d[u][v]+1)
                {
                    d[u][z] = d[z][u] = d[u][v] + 1;
                    sp.push_back(make_pair(u,z));
                }
            }
            swap(u,v);
        }
    }
    double res = 0;
    for(int first=0;first<n;first++)
    {
        double s = 0;
        for(int j=0;j<n;j++)
            z[j].clear();
        for(int j=0;j<n;j++)
            z[ d[first][j] ].push_back(j);

        for(int j=0;j<n;j++)
        if(z[j].size())
        {
            double r = max(1.0/z[j].size(), check(z[j]) );
            s += r*z[j].size()/n;
        }
        if(s>res) res = s;
        //cerr <<s <<endl;
    }
    printf("%.10f",res);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

const int maxn = 405;
const int inf = 1e9;

int n, m, deg[maxn], dist[maxn][maxn];
bool mat[maxn][maxn];
ld p[maxn], best[maxn];
bool u[maxn], u2[maxn];

int V[maxn], vs;
int W[maxn], wsze;
int V2[maxn], v2s;

int main() {
    cin >> n >> m;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            dist[i][j] = inf;
    for (int i = 0; i < n; i++) dist[i][i] = 0;

    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        mat[a][b] = mat[b][a] = 1;
        dist[a][b] = dist[b][a] = 1;
        deg[a]++, deg[b]++;
    }

    for (int k = 0; k < n; k++)
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);

    ld ma = 0;

    for (int i = 0; i < n; i++) {
        ld sum = 0;
        for (int d = 0; d < n; d++) {
            for (int j = 0; j < n; j++) p[j] = u[j] = 0;

            vs = 0;
            for (int j = 0; j < n; j++)
                if (dist[i][j] == d)
                    V[vs++] = j;

            if (vs == 0) continue;

            wsze = 0;
            for (int j1 = 0; j1 < vs; j1++) {
                int j = V[j1];
                for (int k = 0; k < n; k++)
                    if (mat[j][k]) {
                        if (!u[k]) u[k] = 1, W[wsze++] = k;
                        p[k] += ld(1) / (vs * deg[j]);
                    }
            }

            ld ma2 = ld(1) / vs;
            for (int j = 0; j < n; j++) {
                v2s = 0;
                for (int k1 = 0; k1 < wsze; k1++) {
                    int k = W[k1];
                    int x = dist[j][k];
                    if (!u2[x]) u2[x] = 1, V2[v2s++] = x;
                    best[x] = max(best[x], p[k]);
                }
                ld sum2 = 0;
                for (int k1 = 0; k1 < v2s; k1++) {
                    int k = V2[k1];
                    sum2 += best[k];
                    u2[k] = best[k] = 0;
                }
                ma2 = max(ma2, sum2);
            }

            sum += ld(vs) / n * ma2;
            //if (i == 0) cout << sum << ' ' << v.size() << ' ' << w.size() << endl;
            //if (i == 0) cout << ld(v.size()) / n * ma2 << ' ' << ma2 << endl;
        }

        ma = max(ma, sum);
    }

    cout << fixed << setprecision(10) << ma << '\n';
}

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()

int N, M;
int w[401][401];
int last[401], K;
double P1[401], P2[401], mxp[402];

int main()
{
	scanf("%d%d", &N, &M);
	for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) w[i][j] = i == j ? 0 : 1e9;
	for (int i=1;i<=M;i++){
		int a, b; scanf("%d%d", &a, &b);
		w[a][b] = w[b][a] = 1;
	}
	for (int k=1;k<=N;k++) for (int i=1;i<=N;i++) for (int j=1;j<=N;j++)
		w[i][j] = min(w[i][j], w[i][k]+w[k][j]);
	double ans = 0;
	for (int i=1;i<=N;i++){
		double now = 0;
		for (int dist=0;dist<N;dist++){
			vector <int> arr;
			for (int j=1;j<=N;j++) if (w[i][j] == dist){
				arr.pb(j);
			}
			if (!sz(arr)) continue;
			for (int j=1;j<=N;j++) P1[j] = P2[j] = 0;
			for (int t: arr) P1[t] = 1. / sz(arr);
			vector <int> cand;
			for (int t: arr){
				int deg = 0;
				for (int j=1;j<=N;j++) if (w[t][j] == 1) deg++;
				for (int j=1;j<=N;j++) if (w[t][j] == 1) P2[j] += P1[t] / deg, cand.pb(j);
			}
			sort(all(cand)); cand.erase(unique(all(cand)), cand.end());
			double mx = 1. / sz(arr);
			for (int j=1;j<=N;j++){
				++K;
				for (int k: cand){
					if (last[w[j][k]] < K || last[w[j][k]] == K && mxp[w[j][k]] < P2[k])
						last[w[j][k]] = K, mxp[w[j][k]] = P2[k];
				}
				double now2 = 0;
				++K;
				for (int k: cand){
					if (last[w[j][k]] == K) continue;
					last[w[j][k]] = K;
					now2 += mxp[w[j][k]];
				}
				mx = max(mx, now2);
			}
			now += mx * sz(arr) / N;
		}
		ans = max(ans, now);
	}
	printf("%.9f\n", ans);
}

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,ssse3,sse3,sse4,popcnt,avx,mmx,abm,tune=native")
#include <bits/stdc++.h>
using namespace std;

namespace debug{
    void __(short x){cout<<x;}
    void __(int x){cout<<x;}
    void __(long long x){cout<<x;}
    void __(unsigned long long x){cout<<x;}
    void __(double x){cout<<x;}
    void __(long double x){cout<<x;}
    void __(char x){cout<<x;}
    void __(const char*x){cout<<x;}
    void __(const string&x){cout<<x;}
    void __(bool x){cout<<(x?"true":"false");}
    template<class P1,class P2>
    void __(const pair<P1,P2>&x){__("("),__(x.first),__(", "),__(x.second),__(")");}
    template<class T>
    void __(const vector<T>&x){__("{");bool _ffs=0;for(const auto&v:x)__(_ffs?", ":""),__(v),_ffs=1;__("}");}
    void screm(){__("\n");}
    template<class T1,class... T2>
    void screm(const T1&t1,const T2&...t2){__(t1);if(sizeof...(t2))__(" | "),screm(t2...);else __("\n");}
    void pr(){__("\n");}
    template<class T1,class... T2>
    void pr(const T1&t1,const T2&...t2){__(t1);if(sizeof...(t2))__(" "),pr(t2...);else __("\n");}
}

using namespace debug;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef pair<ld,ld> pld;
typedef vector<int> vi;
typedef vector<ll> vl;

#define pb push_back
const int MN = 404;
int N, M, i, j, x, y, dist[MN][MN], cnt[MN], z; double ans, res, _, wew[MN], kk, kkk[MN], r[MN];
double heh[MN][3]; set<pii> f; set<pii> ee; double e[MN*MN];
vi adj[MN]; queue<int> q; vi go;

void ini(int n){
    dist[n][n]=0; q.push(n);
    while(q.size()){
        int x = q.front(); q.pop();
        for(auto v : adj[x]){
            if(dist[n][v]==-1) dist[n][v]=dist[n][x]+1, q.push(v);
        }
    }
}

inline int h(pii x){return x.first*MN+x.second;}
inline int h(int x,int y){return x*MN+y;}

int main(){
    for(scanf("%d%d",&N,&M),i=1;i<=M;i++){
        scanf("%d%d",&x,&y);
        adj[x].pb(y);
        adj[y].pb(x);
    }
    _ = 1.0/(double)N;
    memset(dist,-1,sizeof(dist));
    for(i=1;i<=N;i++) ini(i);
    for(j=1;j<=N;j++){
        memset(cnt,0,sizeof(cnt));
        memset(r,0,sizeof(r));
        memset(heh,0,sizeof(heh));
        for(i=1;i<=N;i++){
            for(auto v : adj[i])
                if(dist[j][v]) heh[i][dist[j][v]-dist[j][i]+1]+=_/(double)adj[v].size();
            cnt[dist[j][i]]++;
        }
        for(i=1;i<=N;i++){
            memset(wew,0,sizeof(wew));
            memset(kkk,0,sizeof(kkk));
            res=0;
            for(auto v : adj[i]) if(v!=j) kkk[dist[j][v]]+=_/(double)adj[v].size();
            for(int k=1;k<=N;k++){
                if(k==i) continue;
                for(int l=0;l<3;l++){
                    z = h(dist[j][k]-1+l,dist[i][k]);
                    if(!e[z]) go.pb(z);
                    e[z]=max(e[z],heh[k][l]);
                }
            }
            for(auto v : go) wew[v/MN]+=e[v],e[v]=0;
            go.clear();
            for(int k=1;k<=N;k++)
                if(cnt[k])r[k]=max(r[k],max(wew[k]+kkk[k],_));
        }
        double acc = 0;
        for(int k=1;k<=N;k++) acc+=r[k];
        ans = max(ans,_+acc);
    }
    printf("%.7lf\n",ans);
    return 0;
}

#include<iostream>
#include<cstdlib>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
#define N 505
#define ll long long
inline int read(){
	int x = 0,f = 1;char ch = getchar();
	while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
	while(ch >= '0' && ch <= '9'){x = x*10+ch-'0';ch = getchar();}
	return x*f;
}

int dis[N][N],q[N];
double b[N],c[N];
int n,m,x,y;
double ans;

int main(){
	n = read(); m = read();
	memset(dis,0x3f,sizeof dis);
	for(int i = 1;i <= n;i++)
		dis[i][i] = 0;
	for(int i = 1;i <= m;i++){
		int x = read(),y = read();
		dis[x][y] = dis[y][x] = true;
	}
	for(int k = 1;k <= n;k++)
		for(int i = 1;i <= n;i++)
			for(int j = 1;j <= n;j++)
				dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]);
	for(int i = 1;i <= n;i++){
		double r = 0;
		for(int j = 0;j < n;j++){
			int u = 0,p = 0;
			double t = 0;
			memset(b,0,sizeof b);
			for(int k = 1;k <= n;k++){
				if(dis[i][k] == j){
					int v = 0;
					u++;
					for(int l = 1;l <= n;l++)
						if(dis[k][l] == 1)
							v++;
					for(int l = 1;l <= n;l++)
						if(dis[k][l] == 1)
							b[l] += 1.0/v;
				}
			}
			for(int k = 1;k <= n;k++)
				if(abs(dis[i][k]-j) <= 1)
					q[++p] = k;
			for(int k = 1;k <= n;k++){
				double w = 0;
				for(int l = 1;l <= p;l++)
					if(b[q[l]] > c[dis[k][q[l]]])
						c[dis[k][q[l]]] = b[q[l]];
				for(int l = 1;l <= p;l++){
					w += c[dis[k][q[l]]];
					c[dis[k][q[l]]] = 0;
				}
				t = max(t,w);
			}
			if(u)
				t = max(t,1.0);
			r += t/n;
		}
		ans = max(ans,r);
	}
	printf("%.12lf\n",ans);
	return 0;
}

#include <cstdio>
#include <cstring>
#include <vector>
static const int INF = 0x3fffffff;
static const int MAXN = 418;    // I'm a teapot =u=
typedef std::vector<int> edgelist;

template <typename T> inline T min(const T a, const T b) {
    return a < b ? a : b;
}
template <typename T> inline T max(const T a, const T b) {
    return a > b ? a : b;
}

int n, m;
edgelist e[MAXN];
int d[MAXN][MAXN];

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < n; ++j)
            d[i][j] = (i == j ? 0 : INF);

    int u, v;
    for (int i = 0; i < m; ++i) {
        scanf("%d%d", &u, &v); --u; --v;
        e[u].push_back(v);
        e[v].push_back(u);
        d[u][v] = d[v][u] = 1;
    }
    for (int k = 0; k < n; ++k)
        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);

    double ans = 0.0;
    for (int g1 = 0; g1 < n; ++g1) {
        double cur = 0.0;
        for (int d1 = 0; d1 < n; ++d1) {
            int valid_ct = 0;
            for (int i = 0; i < n; ++i)
                if (d[g1][i] == d1) ++valid_ct;
            if (valid_ct == 0) continue;

            double nextday = 0.0;
            std::vector<int> omoshiroi;
            static double prob[MAXN], prob_in_dist[MAXN];
            memset(prob, 0, sizeof prob);
            //memset(prob_in_dist, 0, sizeof prob_in_dist);
            for (int u = 0; u < n; ++u) if (d[g1][u] == d1)
                for (edgelist::iterator v = e[u].begin(); v != e[u].end(); ++v) {
                    if (prob[*v] == 0) omoshiroi.push_back(*v);
                    prob[*v] += 1.0 / valid_ct / e[u].size();
                }
            for (int g2 = 0; g2 < n; ++g2) {
                double cur = 0.0;
                for (std::vector<int>::iterator i = omoshiroi.begin(); i != omoshiroi.end(); ++i)
                    prob_in_dist[d[g2][*i]] = max(prob_in_dist[d[g2][*i]], prob[*i]);
                for (std::vector<int>::iterator i = omoshiroi.begin(); i != omoshiroi.end(); ++i) {
                    cur += prob_in_dist[d[g2][*i]];
                    prob_in_dist[d[g2][*i]] = 0.0;
                }
                nextday = max(nextday, cur);
            }

            // http://codeforces.com/blog/entry/45310#comment-298820
            cur += max(1.0 / valid_ct, nextday) * valid_ct / n;
        }
        ans = max(ans, cur);
    }

    printf("%.12lf\n", ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

/* 做法：暴力是O(N^4)的
 * 然后我们发现一个性质是一个点的相邻点（走一步）对于第二天的查询点的距离变化只有三种
 * 情况：+1, 0, -1……【性质找的差不多，不过脑抽了，之后按题解】题解是对于同一个第一天
 * 的查询点每个点其实只会被用到三次(枚举的距离为d-1,d,d+1)……于是点数从O(M)变成O(N)
 * 了，改一下暴力即可
 */

// 用unordered_map实现的极限数据跑了数组实现的8倍……交上去怒T一发……

using vi = vector<int>;

inline void minto(int &a, int b) { a = min(a, b); }
inline void maxto(double &a, double b) { a = max(a, b); }

const int mxn = 406;

int n, m;
vi e[mxn];
int dist[mxn][mxn];

vi s[mxn];

double P[mxn]; // P[点] = 走到的概率
double PD[mxn]; // PD[距离] = 最大概率

int main() {
	cin >> n >> m;
	//~ n = 400, m = n * n;
	memset(dist, 63, sizeof dist);
	for (int i = 1; i <= n; ++i)
		dist[i][i] = 0;
	for (int i = 0; i < m; ++i) {
		int x, y;
		scanf("%d%d", &x, &y);
		//~ x = i / n + 1, y = i % n + 1;
		dist[x][y] = dist[y][x] = 1;
		e[x].push_back(y);
		e[y].push_back(x);
	}

	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			for (int k = 1; k <= n; ++k)
				minto(dist[j][k], dist[j][i] + dist[i][k]);

	double ans = 0;
	for (int i = 1; i <= n; ++i) { // 第一天
		double sum = 0;
		fill(s, s + n, vi{});
		for (int j = 1; j <= n; ++j)
			s[dist[i][j]].push_back(j); // = {第一天的距离, 点集}
		for (int j = 0; j < n; ++j) if (!s[j].empty()) { // 枚举距离
			double P1 = 1.0 / n; // 直接猜
			double P2 = 0; // 第二天继续
			vector<int> V = s[j];
			if (j - 1 >= 0)
				V.insert(V.end(), s[j - 1].begin(), s[j - 1].end());
			if (j + 1 < n)
				V.insert(V.end(), s[j + 1].begin(), s[j + 1].end());

			for (auto y : V)
				P[y] = 0;

			for (auto x : s[j])
				for (auto y : e[x])
					P[y] += 1.0 / n / e[x].size();

			for (int k = 1; k <= n; ++k) { // 第二天
				for (auto x : V)
					maxto(PD[dist[k][x]], P[x]);
				double psum = 0;
				for (auto x : V) {
					psum += PD[dist[k][x]];
					PD[dist[k][x]] = 0;
				}
				maxto(P2, psum);
			}
			sum += max(P1, P2);
		}
		ans = max(ans, sum);
	}

	cout.setf(ios::fixed);
	cout.precision(12);
	cout << ans << endl;

	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=405;
int n,m,i,j,k,x,y,len,q[N],dis[N][N];
double pb[N],gt[N],ans;
double gmax(double &x,double &k){if (k>x) x=k;}
int main(){
	memset(dis,1,sizeof(dis));
	for (scanf("%d%d",&n,&i);i--;){
		scanf("%d%d",&x,&y);
		dis[x][y]=dis[y][x]=1;
	}
	for (i=1;i<=n;i++) dis[i][i]=0;
	for (k=1;k<=n;k++) for (i=1;i<=n;i++) for (j=1;j<=n;j++)
		dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for (x=1;x<=n;x++){
		double res=0,mx,now;
		for (len=0;len<n;len++){
			memset(pb,0,sizeof(pb));int cnt=0;
			for (i=1;i<=n;i++) if (dis[x][i]==len){
				int num=0;cnt++;
				for (j=1;j<=n;j++) if (dis[i][j]==1) num++;
				for (j=1;j<=n;j++) if (dis[i][j]==1) pb[j]+=1.0/num;
			}
			if (!cnt) continue;if (cnt==1){res+=1;continue;}
			for (m=0,i=1;i<=n;i++) if (abs(len-dis[x][i])<=1) q[++m]=i;
			for (mx=0,i=1;i<=n;i++){
				for (j=1;j<=m;j++) gmax(gt[dis[i][q[j]]],pb[q[j]]);
				for (now=0,j=1;j<=m;j++)
					now+=gt[dis[i][q[j]]],gt[dis[i][q[j]]]=0;
				mx=max(mx,now);
			}
			res+=max(mx,1.0);
		}
		ans=max(ans,res);
	}
	printf("%.12lf",ans/n);
}

#include <bits/stdc++.h>
using namespace std;

// Numeric Constants
#define N 1000000007
#define maxs 200005
#define mins 1005
#define eps 0.000000000001
#define imax 2000000200
#define llmax 1000000002000000000ll
#define pi 3.141592653589793

// Others
#define ll long long
#define pb push_back
#define gc getchar_unlocked
#define iosbase ios_base::sync_with_stdio(false)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ppi pair<pair<ll,ll>,ll>
#define ppl pair<pll,ll>
#define vi vector<int>
#define sc scanf
#define pr printf
#define lld I64d
#define F first
#define S second
#define siter set<int>::iterator
#define p_pq priority_queue
#define ub upper_bound
#define lb lower_bound
#define mps make_pair

int dist[402][402];
vector<int>adj[405];
double prob[405];
int mark[405];
vector<int>v;
double current[405];

int main()
{
	int n,m,i,j,k,d,x,y, cnt;
	sc("%d %d", &n,&m);
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			dist[i][j]=500;
		}
	}
	for(i=0;i<m;i++){
		sc("%d %d", &x, &y);
		dist[x][y]=1;
		dist[y][x]=1;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	for(i=0;i<=n;i++){
		dist[i][i]=0;
	}
	for(k=1;k<=n;k++){
		for(i=1;i<=n;i++){
			for(j=1;j<=n;j++){
				dist[i][j]=min(dist[i][j], dist[i][k]+dist[k][j]);
			}
		}
	}
	double ans=0;
	for(i=1;i<=n;i++){
		double ans1=0;
		for(d=0;d<=n;d++){
			cnt=0;
			for(j=1;j<=n;j++){
				if(dist[i][j]==d){
					cnt++;
				}
			}
			double proba= (double)1/n; // cnt/n * 1/cnt
			if(cnt==0){
				continue;
			}
			for(j=1;j<=n;j++){
				mark[j]=0;
				prob[j]=0;
			}
			for(j=1;j<=n;j++){
				if(dist[i][j]==d){
					for(k=0;k<adj[j].size();k++){
						prob[adj[j][k]]+=(double)1/(n*adj[j].size());
						if(!mark[adj[j][k]]){
							v.pb(adj[j][k]);
							mark[adj[j][k]]=1;
						}
					}
				}
			}
			double temp2=0;
			for(j=1;j<=n;j++){
				for(k=0;k<v.size();k++){
					current[dist[j][v[k]]]=max(current[dist[j][v[k]]], prob[v[k]]);
				}
				double temp=0;
				for(k=0;k<v.size();k++){
					temp+=current[dist[j][v[k]]];
					current[dist[j][v[k]]]=0;
				}
				temp2=max(temp2,temp);
			}
			v.clear();
			ans1+=max(temp2, proba);
		}
		ans=max(ans,ans1);
	}
	pr("%.10lf\n", ans);
	return 0;
}

#include<bits/stdc++.h>
#define vi vector<int>
#define pb push_back
using namespace std;

const int inf=10000;
const double eps=1e-9;
int n,m,d[405][405],du[405],vis[405],g[405][405],num[405];
double si[405],maxx[405];

inline void upt(double &x,double y){
	if(y>=x) x=y;
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(i==j) d[i][j]=0; else d[i][j]=inf;
	for(int i=1;i<=m;i++){
		int x,y;scanf("%d%d",&x,&y);
		d[x][y]=d[y][x]=1;
		du[x]++;du[y]++;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
	double ans=0;
	for(int i=1;i<=n;i++){
		double mx=0,tmp=0;
		int tot=0;
		memset(num,0,sizeof(num));
		for(int j=1;j<=n;j++){
			int t=d[i][j];
			g[t][++num[t]]=j;
		}
		for(int j=0;j<=n;j++)
			if(num[j]==1) tmp+=1.0;
			else if(num[j]>1){
				for(int k=1;k<=n;k++) si[k]=0.0;
				tot=0;
				for(int tt=1;tt<=num[j];tt++){
					int k=g[j][tt];
					for(int l=1;l<=n;l++)
						if(d[k][l]==1) si[l]+=1.0/(double)du[k];
				}
				for(int k=1;k<=n;k++)
					if(si[k]>eps) vis[++tot]=k;
				double res=0.0;
				for(int k=1;k<=n;k++){
					double t=0.0;
					for(int l=1;l<=tot;l++)
						upt(maxx[d[k][vis[l]]],si[vis[l]]);
					for(int l=1;l<=tot;l++)
						t+=maxx[d[k][vis[l]]],maxx[d[k][vis[l]]]=0.0;
					res=max(res,t);
				}
				tmp+=max(1.0,res);
			}
		ans=max(ans,tmp);
	//	printf("%.9lf\n",tmp);
	}
	printf("%.12lf\n",ans/(double)n);
	return 0;
}

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <ctime>
#include <map>
#include <queue>
#include <cstdlib>
#include <string>
#include <climits>
#include <set>
#include <vector>
using namespace std;
typedef double D;
inline int read(){
	int k=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}
	return k*f;
}
int nedge=0,p[200010],nex[200010],head[200010],s[200010];
int n,m,f[410][410],q[100010];
bool vis[2010];
D rp[2010],pr[2010];
inline void addedge(int a,int b){
	p[++nedge]=b;nex[nedge]=head[a];head[a]=nedge;
}
inline D work(int x,int y,int z){
	D maxx=0;memset(vis,0,sizeof vis);memset(rp,0,sizeof rp);
	int cnt=0;
	vector<int>a;
	for(int i=1;i<=n;i++)if(f[y][i]==z)
		for(int k=head[i];k;k=nex[k]){
			rp[p[k]]+=1.0/n/(double)s[i];
			if(!vis[p[k]])a.push_back(p[k]),vis[p[k]]=1;
		}
	for(int i=1;i<=n;i++){
		D sum=0;
		for(int k:a)pr[f[i][k]]=max(pr[f[i][k]],rp[k]);
		for(int k:a)sum+=pr[f[i][k]],pr[f[i][k]]=0;
		maxx=max(maxx,sum);
	}
	return maxx;
}
int main()
{
	n=read();m=read();
	memset(f,0x3f,sizeof f);
	for(int i=1;i<=n;i++)f[i][i]=0;
	for(int i=1;i<=m;i++){
		int x=read(),y=read();
		addedge(x,y);addedge(y,x);
		s[x]++;s[y]++;
		f[x][y]=f[y][x]=1;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	D ans=0;
	for(int i=1;i<=n;i++){
		D sum=0;
		for(int j=0;j<=n;j++){
			int cnt=0;
			for(int k=1;k<=n;k++)if(f[i][k]==j)cnt++;
			if(!cnt)continue;
			sum+=max(1.0/n,work(n,i,j));
		}
		ans=max(ans,sum);
	}
	printf("%.8lf",ans);
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_set>
#include <limits>
using namespace std;
const int N = 405;
vector<int> mat[N];
int dist[N][N];
double p_day2[N], p_dist[N];
int main()
{
	int n, m;
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			dist[i][j] = i == j ? 0 : n;
	while (m--)
	{
		int u, v;
		cin >> u >> v;
		mat[u].push_back(v);
		mat[v].push_back(u);
		dist[u][v] = dist[v][u] = 1;
	}
	for (int k = 1; k <= n; k++)
		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
	double ans = .0;
	for (int day1 = 1; day1 <= n; day1++)
	{
		double now = .0;
		for (int dist1 = 0; dist1 < n; dist1++)
		{
			int cnt = count(dist[day1] + 1, dist[day1] + n + 1, dist1);
			if (!cnt)
				continue;
			fill(p_day2 + 1, p_day2 + n + 1, .0);
			unordered_set<int> S;
			for (int u = 1; u <= n; u++)
				if (dist[day1][u] == dist1)
					for (auto v : mat[u])
					{
						S.insert(v);
						p_day2[v] += 1.0 / n / mat[u].size();
					}
			double max_p_day2 = .0;
			for (int day2 = 1; day2 <= n; day2++)
			{
				for (auto u : S)
					p_dist[dist[day2][u]] = max(p_dist[dist[day2][u]], p_day2[u]);
				double sum = .0;
				for (auto u : S)
				{
					sum += p_dist[dist[day2][u]];
					p_dist[dist[day2][u]] = .0;
				}
				max_p_day2 = max(max_p_day2, sum);
			}
			now += max(1.0 / n, max_p_day2);
		}
		ans = max(ans, now);
	}
	cout.precision(numeric_limits<double>::digits10);
	cout << ans << endl;
	return 0;
}

#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef long double ld;

const int Maxn = 405;
const int Inf = 1000000000;

int n, m;
int dist[Maxn][Maxn];
vector <int> V[Maxn];
ld prob[Maxn], mx[Maxn];
ld res;
int seq[Maxn], slen;
int bseq[Maxn], blen;

int main()
{
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			dist[i][j] = (i != j) * Inf;
	while (m--) {
		int a, b; scanf("%d %d", &a, &b);
		dist[a][b] = dist[b][a] = 1;
	}
	for (int k = 1; k <= n; k++)
		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= n; j++)
			V[j].clear();
		for (int j = 1; j <= n; j++)
			V[dist[i][j]].push_back(j);
		ld my = 0.0;
		for (int j = 0; j <= n; j++) if (!V[j].empty()) {
			ld best = 1 / ld(n);

			fill(prob, prob + n + 1, 0);
			slen = 0;
			for (int z = 0; z < V[j].size(); z++) {
				int v = V[j][z];
				int neighs = 0;
				for (int c = 1; c <= n; c++)
					if (dist[v][c] == 1) neighs++;
				for (int c = 1; c <= n; c++)
					if (dist[v][c] == 1) {
						if (prob[c] < 1e-9) seq[slen++] = c;
						prob[c] += 1 / ld(neighs);
					}
			}
			for (int l = 1; l <= n; l++) {
				for (int z = 0; z < blen; z++)
					mx[bseq[z]] = 0;
				blen = 0;
				for (int z = 0; z < slen; z++) {
					int d = dist[l][seq[z]];
					if (mx[d] < 1e-9) bseq[blen++] = d;
					mx[d] = max(mx[d], prob[seq[z]]);
				}
				ld cand = 0.0;
				for (int z = 0; z < blen; z++)
					cand += mx[bseq[z]];
				best = max(best, cand / n);
			}
			my += best;
		}
		res = max(res, my);
	}
	printf("%.15lf\n", double(res));
	return 0;
}

#include<bits/stdc++.h>
#define INPUT_LEN 1000
#define inf 0x3f3f3f3f
#define pb push_back
#define y second
#define x first

typedef double DO;
using namespace std;
template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}
char gchar(){static char tbuf1[INPUT_LEN],*tmp_st=tbuf1,*tmp_ed=tbuf1;if(tmp_st==tmp_ed){int len=fread(tbuf1,1,INPUT_LEN,stdin);if(len==0)return-1;tmp_ed=tbuf1+len;tmp_st=tbuf1;}return*(tmp_st++);}
inline bool gn(int&x){char c,sg=0;while(c=gchar(),(c>'9'||c<'0')&&c!='-'&&~c);if(c==-1)return 0;for((c=='-'?sg=1,c=gchar():0),x=0;c>='0'&&c<='9';c=gchar())x=(x<<1)+(x<<3)+c-'0';if(sg)x=-x;return 1;}

#define NN 410

int d[NN][NN];
vector<int> vec[NN][NN], pos;
DO pro[NN], Mx[NN];

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int n, m; gn(n), gn(m);
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n; j++) d[i][j]=n;
		d[i][i]=0;
	}
	while(m--) {
		int u, v; gn(u), gn(v);
		d[u][v]=d[v][u]=1;
	}
	for(int k=1; k<=n; k++) {
		for(int i=1; i<=n; i++) {
			for(int j=1; j<=n; j++) {
				smin(d[i][j], d[i][k]+d[k][j]);
			}
		}
	}
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n; j++) {
			vec[i][d[i][j]].pb(j);
		}
	}

	DO mx=0;
	for(int one=1; one<=n; one++) {
		DO ans=0;
		for(int i=n; i--; ) {
			if(vec[one][i].size()==1) ans+=1./n;
			if(vec[one][i].size()>1) {
				for(int j=1; j<=n; j++) pro[j]=0;
				pos.clear();
				for(int j: vec[one][i]) {
					DO v=1./n/vec[j][1].size();
					for(int x: vec[j][1]) {
						if(pro[x]<1e-9) pos.pb(x);
						pro[x]+=v;
					}
				}
				DO maximum=1./n;
				for(int j=1; j<=n; j++) {
					DO sum=0;
					for(int x: pos) smax(Mx[d[j][x]], pro[x]);
					for(int x: pos) sum+=Mx[d[j][x]], Mx[d[j][x]]=0;
					smax(maximum, sum);
				}
				ans+=maximum;
			}
		}
		smax(mx, ans);
	}
	cout<<fixed<<setprecision(6)<<mx<<endl;
}

#include<bits/stdc++.h>
#define Ll long long
using namespace std;
const Ll N=400+5;
vector<int>a[N],S,Q;
double p[N],d[N],ans,temp;
bool in[N];
int f[N][N];
int n,m,x,y,z;
double out(){
	for(int i=0;i<S.size();i++)
		for(int j=0;j<a[S[i]].size();j++){
			int x=a[S[i]][j];
			p[x]+=1./n/a[S[i]].size();
			if(!in[x])in[x]=1,Q.push_back(x);
		}
	double ans=0,temp;
	for(int i=1;i<=n;i++){
		temp=0;
		for(int j=0;j<Q.size();j++)
			d[f[Q[j]][i]]=max(d[f[Q[j]][i]],p[Q[j]]);
		for(int j=0;j<Q.size();j++){
			temp+=d[f[Q[j]][i]];
			d[f[Q[j]][i]]=0;
		}
		ans=max(ans,temp);
	}
	for(int i=0;i<Q.size();i++)
		in[Q[i]]=0,p[Q[i]]=0;
	Q.clear();
	return ans;
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(i!=j)f[i][j]=1e9;
	for(int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		a[x].push_back(y);
		a[y].push_back(x);
		f[x][y]=f[y][x]=1;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				if(f[i][j]>f[i][k]+f[k][j])
					f[i][j]=f[i][k]+f[k][j];
	for(int i=1;i<=n;i++){
		temp=0;
		for(int j=0;j<=n;j++){
			S.clear();
			for(int k=1;k<=n;k++)
				if(f[i][k]==j)S.push_back(k);
			if(S.empty())continue;
			temp+=max(1./n,out());
		}
		ans=max(ans,temp);
	}
	printf("%.12lf",ans);
}

#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <cassert>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <time.h>
using namespace std;

#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, b, a) for(int i=(b)-1;i>=(a);--i)
#define FILL(A,value) memset(A,value,sizeof(A))

#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define Pi 3.14159265358979
#define x0 ikjnrmthklmnt
#define y0 lkrjhkltr
#define y1 ewrgrg

typedef long long Int;
typedef unsigned long long UInt;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<Int, Int> PLL;
typedef pair<double, double> PDD;

const int INF = 1000000000;
const int BASE = 1000000007;
const int MAX = 507;
const int MAX2 = 10007;
const int MAXE = 100000;
const int ADD = 1000000;
const int MOD = 1000000007;
const int CNT = 0;

int d[MAX][MAX];

vector<PII> C[MAX];

double p2[MAX];

int deg[MAX];

pair<int, double> A[MAX];

int To[MAX];

int main()
{
	//freopen("in.txt" , "r" , stdin);

	int n , m;
	cin >> n >> m;

	//n = 400;

	FOR(i,0,n)
	{
		FOR(j,0,n)
		{
			d[i][j] = INF;
		}
		d[i][i] = 0;
	}

	FOR(i,0,m)
	{
		int a , b;
		scanf("%d %d" , &a , &b);
		--a; --b;
		d[a][b] = d[b][a] = 1;
		deg[a] ++ ;
		deg[b] ++ ;
	}
	/*FOR(i,0,n)
	{
		FOR(j,0, n)
		{
			if (j < 0 || j >= n) continue;
			if (i == j)
				continue;
			d[i][j] = 1;
			++ deg[i];
		}
	}*/

	FOR(k,0,n)
	{
		FOR(i,0,n)
		{
			FOR(j,0,n)
			{
				d[i][j] = min(d[i][j] , d[i][k] + d[k][j]);
			}
		}
	}

	FOR(i,0,n)
	{
		FOR(j,0,n)
		{
			C[i].push_back(MP(d[i][j] , j));
		}
		sort(ALL(C[i]));
	}

	double res = 0;

	FOR(i,0,n)
	{
		int ptr = 0;
		double P = 0;
		while (ptr < n)
		{
			int add = 1;
			while (ptr + add < n && C[i][ptr + add].first == C[i][ptr].first) ++add;

			double pp = 1.0 / n;
			FILL(p2, 0);

			FOR(j,ptr , ptr + add)
			{
				int v = C[i][j].second;
				FOR(k,0,n)
				{
					if (d[v][k] == 1)
					{
						p2[k] += 1.0 / n / deg[v];
					}
				}
			}

			int szTo = 0;
			double sum = 0;
			FOR(j,0,n)
			{
				if (p2[j] > 1e-6)
				{
					To[szTo ++] = (j);
					sum += p2[j];
				}
			}

			FOR(j,0,n)
			{
				int szA = 0;
				double cur = 0;

				if (szTo < 50)
				{

					FOR(k,0,szTo)
					{
						int to = To[k];
						A[szA ++] = (MP(d[j][to] , p2[to]));
					}

					sort(A , A + szA);
				}
				else
				{
					FOR(k,0,n)
					{
						int to = C[j][k].second;
						if (p2[to] < 1e-6) continue;
						A[szA ++] = MP(d[j][to] , p2[to]);
					}
				}

				int ptr2 = 0;
				while (ptr2 < szA)
				{
					int add2 = 1;
					while (ptr2 + add2 < szA && A[ptr2].first == A[ptr2 + add2].first) ++ add2;
					double mx = 0;
					FOR(k,ptr2 , ptr2 + add2)
					{
						mx = max(mx , A[k].second);
					}
					cur += mx;
					ptr2 += add2;
				}

				pp = max(pp , cur);
			}

			//cout << ptr << ' ' << pp << endl;

			P += pp;
			ptr += add;
		}
		//cout << endl;
		res = max(res , P);

	}

	printf("%.10f\n" , res);

	//cout << 1.0 * clock() / CLOCKS_PER_SEC << endl;

    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#define SIZE 405
#define EPS 1e-10

using namespace std;
typedef long double ld;

int dist[SIZE][SIZE];
vector <int> vec[SIZE];
vector <int> edge[SIZE];
bool use[SIZE],use2[SIZE];
ld mx2[SIZE];
ld dp[SIZE];
int nd[SIZE],nd2[SIZE];

int main()
{
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++) dist[i][j]=n*2;
		dist[i][i]=0;
	}
	for(int i=0;i<m;i++)
	{
		int a,b;
		scanf("%d %d",&a,&b);a--;b--;
		dist[a][b]=dist[b][a]=1;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			for(int k=0;k<n;k++)
			{
				dist[j][k]=min(dist[j][k],dist[j][i]+dist[i][k]);
			}
		}
	}
	ld ret=0.0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++) vec[j].clear();
		for(int j=0;j<n;j++) vec[dist[i][j]].push_back(j);
		ld sum=0.0;
		for(int j=0;j<n;j++)
		{
			if(!vec[j].empty())
			{
				ld mx=1.0/(ld) vec[j].size();
				int sz=0;
				for(int k=0;k<vec[j].size();k++)
				{
					int v=vec[j][k];
					for(int p=0;p<edge[v].size();p++)
					{
						int to=edge[v][p];
						if(!use[to])
						{
							use[to]=true;
							nd[sz++]=to;
						}
						dp[to]+=1.0/(ld) (edge[v].size()*vec[j].size());
					}
				}
				for(int k=0;k<n;k++)
				{
					int sz2=0;
					for(int p=0;p<sz;p++)
					{
						int d=dist[k][nd[p]];
						if(!use2[d])
						{
							use2[d]=true;
							nd2[sz2++]=d;
						}
						mx2[d]=max(mx2[d],dp[nd[p]]);
					}
					ld cnt=0.0;
					for(int p=0;p<sz2;p++)
					{
						int d=nd2[p];
						use2[d]=false;
						cnt+=mx2[d];
						mx2[d]=0.0;
					}
					mx=max(mx,cnt);
				}
				sum+=mx*vec[j].size();/*
				if(i==0)
				{
					printf("%d %d : %f\n",j,vec[j].size(),(double) mx);
					for(int k=0;k<sz;k++) printf("* %d %f\n",nd[k],(double) dp[nd[k]]);
				}*/
				for(int k=0;k<sz;k++)
				{
					dp[nd[k]]=0.0;
					use[nd[k]]=false;
				}
			}
		}
		ret=max(ret,sum/(ld) n);
		//printf("%d %f\n",i,(double) (sum/(ld) n));
	}
	printf("%.10f\n",(double) ret);
	return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 410
using namespace std;
int a[N][N] , d[N] , dis[N][N] , cnt[N] , id[N];
double val[N] , p[N];
int main()
{
	//freopen("detective.in" , "r" , stdin);
	//freopen("detective.out" , "w" , stdout);
	int n , m , i , j , k , l , x , y , tot;
	double ans = 0 , ret , now , tmp;
	scanf("%d%d" , &n , &m);
	memset(dis , 0x3f , sizeof(dis));
	for(i = 1 ; i <= m ; i ++ ) scanf("%d%d" , &x , &y) , a[x][y] = a[y][x] = dis[x][y] = dis[y][x] = 1 , d[x] ++ , d[y] ++ ;
	for(i = 1 ; i <= n ; i ++ ) dis[i][i] = 0;
	for(k = 1 ; k <= n ; k ++ )
		for(i = 1 ; i <= n ; i ++ )
			for(j = 1 ; j <= n ; j ++ )
				dis[i][j] = min(dis[i][j] , dis[i][k] + dis[k][j]);
	for(i = 1 ; i <= n ; i ++ )
	{
		ret = 0;
		memset(cnt , 0 , sizeof(cnt));
		for(j = 1 ; j <= n ; j ++ ) cnt[dis[i][j]] ++ ;
		for(j = 0 ; j < n ; j ++ )
		{
			if(cnt[j])
			{
				now = 1.0 / cnt[j];
				memset(val , 0 , sizeof(val));
				for(k = 1 ; k <= n ; k ++ )
					if(dis[i][k] == j)
						for(l = 1 ; l <= n ; l ++ )
							if(a[k][l])
								val[l] += 1.0 / cnt[j] / d[k];
				tot = 0;
				for(k = 1 ; k <= n ; k ++ )
					if(val[k] > 0)
						id[++tot] = k;
				for(k = 1 ; k <= n ; k ++ )
				{
					tmp = 0;
					for(l = 1 ; l <= tot ; l ++ ) p[dis[k][id[l]]] = max(p[dis[k][id[l]]] , val[id[l]]);
					for(l = 1 ; l <= tot ; l ++ ) tmp += p[dis[k][id[l]]] , p[dis[k][id[l]]] = 0;
					now = max(now , tmp);
				}
				ret += now * cnt[j] / n;
			}
		}
		ans = max(ans , ret);
	}
	printf("%.15lf\n" , ans);
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=405;
int f[N][N],q[N],n,m;
double ans,b[N],c[N];
int main(){
	scanf("%d%d",&n,&m);
	For(i,1,n) For(j,1,n)
		f[i][j]=(i==j?0:1<<20);
	For(i,1,m){
		int x,y;
		scanf("%d%d",&x,&y);
		f[x][y]=f[y][x]=1;
	}
	For(k,1,n) For(i,1,n) For(j,1,n)
		f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	For(i,1,n){
		double val=0;
		For(j,0,n-1){
			double mxv=0;
			For(k,1,n) b[k]=0;
			For(k,1,n) if (f[i][k]==j){
				mxv=1; int sum=0;
				For(l,1,n) if (f[k][l]==1) ++sum;
				For(l,1,n) if (f[k][l]==1) b[l]+=1.0/sum;
			}
			*q=0;
			For(k,1,n)
				if (fabs(f[i][k]-j)<=1)
					q[++*q]=k;
			For(k,1,n){
				double sum=0;
				For(l,1,*q)
					if (b[q[l]]>c[f[k][q[l]]]){
						sum-=c[f[k][q[l]]];
						sum+=(c[f[k][q[l]]]=b[q[l]]);
					}
				mxv=max(mxv,sum);
				For(l,1,*q)
					c[f[k][q[l]]]=0;
			}
			val+=mxv;
		}
		ans=max(ans,val/n);
	}
	printf("%.10lf\n",ans);
}

#include <bits/stdc++.h>

#define ll long long

#define SZ(x) (int)(x).size()
#define pb push_back

template<class T>inline void chkmax(T &x, const T &y) {if(x < y) x = y;}
template<class T>inline void chkmin(T &x, const T &y) {if(x > y) x = y;}

template<class T>
inline void read(T &x) {
    char c;int f = 1;x = 0;
    while(((c=getchar()) < '0' || c > '9') && c != '-');
    if(c == '-') f = -1;else x = c-'0';
    while((c=getchar()) >= '0' && c <= '9') x = x*10+c-'0';
    x *= f;
}
template<class T>
inline void write(T x) {
    static int outn;
    static char out[(int)2e7];
    if(x < 0) out[outn++] = '-', x = -x;
    if(x) {
        static int tmpn;
        static char tmp[20];
        tmpn = 0;
        while(x) tmp[tmpn++] = x%10+'0', x /= 10;
        while(tmpn) out[outn++] = tmp[--tmpn];
    }
    else out[outn++] = '0';
}

const int N = 400;
const int INF = 1e9;

int n, m;
int deg[N+9];
bool adj[N+9][N+9];
int g[N+9][N+9];
std::pair<int,int> p[N+9];
int a[N+9], an;
int b[N+9], bn;
int vis[N+9], visc;
double f[N+9];
double h[N+9];
int q[N+9], qn;

double ans;

inline double work(std::pair<int,int> *p, int pn) {
    ++visc, an = pn, bn = 0;
    for(int i = 1; i <= an; ++i) a[i] = p[i].second;
    std::fill(f+1, f+n+1, 0);
    for(int i = 1; i <= an; ++i)
        for(int j = 1; j <= n; ++j)
            if(adj[a[i]][j]) {
                f[j] += 1.0/(an*deg[a[i]]);
                if(vis[j] != visc) vis[j] = visc, b[++bn] = j;
            }
    double ret = 0;
    for(int i = 1; i <= n; ++i) {
        double cur = 0;
        std::fill(h, h+n, 0);
        ++visc, qn = 0;
        for(int j = 1; j <= bn; ++j)
            if(g[i][b[j]] < INF) {
                chkmax(h[g[i][b[j]]], f[b[j]]);
                if(vis[g[i][b[j]]] != visc) {
                    q[++qn] = g[i][b[j]];
                    vis[g[i][b[j]]] = visc;
                }
            }
        for(int j = 1; j <= qn; ++j)
            cur += h[q[j]];
        chkmax(ret, cur);
    }
    return ret;
}

int main() {
    read(n), read(m);
    for(int i = 1; i <= n; ++i)
        for(int j = 1; j <= n; ++j)
            if(i != j) g[i][j] = INF;
            else g[i][j] = 0;
    while(m--) {
        int u, v;
        read(u), read(v);
        deg[u]++, deg[v]++;
        adj[u][v] = adj[v][u] = true, g[u][v] = g[v][u] = 1;
    }
    for(int k = 1; k <= n; ++k)
        for(int i = 1; i <= n; ++i)
            for(int j = 1; j <= n; ++j)
                chkmin(g[i][j], g[i][k]+g[k][j]);
    for(int i = 1; i <= n; ++i) {
        double cur = 0;
        for(int j = 1; j <= n; ++j)
            p[j] = std::make_pair(g[i][j], j);
        std::sort(p+1, p+n+1);
        for(int j = 1; j <= n; ++j) {
            int k = j;
            while(k < n && p[k+1].first == p[j].first) ++k;
            cur += std::max((double)(k-j+1)/n*work(p+j-1, k-j+1), 1.0/n);
            j = k;
        }
        chkmax(ans, cur);
    }
    printf("%.10lf\n", ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define N 410
#define eps 1e-9
int n,m,n1,cnt,n2;
int mp[N][N],mp1[N][N];
int p1[N],du[N],p2[N];
double pro[N],ans;
int cmp(int x,int y)
{return mp[n1][x]<mp[n1][y];}
int cmp1(int x,int y)
{return mp[n2][x]<mp[n2][y];}
int main()
{
	//freopen("tt.in","r",stdin);
	scanf("%d%d",&n,&m);
	memset(mp,0x3f,sizeof(mp));
	for(int i=1,x,y;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		du[x]++;du[y]++;
		mp[x][y]=mp[y][x]=1;
		mp1[x][y]=mp1[y][x]=1;
	}
	for(int i=1;i<=n;i++)mp[i][i]=0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			for(int k=1;k<=n;k++)
				mp[j][k]=min(mp[j][k],mp[j][i]+mp[i][k]);
	for(int i=1;i<=n;i++)
	{
		n1=i;
		for(int j=1;j<=n;j++)p1[j]=j;
		sort(p1+1,p1+1+n,cmp);
		double pr1=0;
		for(int j=1,now;j<=n;j=now+1)
		{
			for(now=j;now<=n&&mp[i][p1[j]]==mp[i][p1[now]];now++);now--;
			double pr2=1.0/(now-j+1),sum=0;
			memset(pro,0,sizeof(pro));
			for(int k=j;k<=now;k++)
				for(int w=1;w<=n;w++)if(mp1[p1[k]][w])
					pro[w]+=1.0/du[p1[k]];
			cnt=0;
			for(int k=1;k<=n;k++)if(pro[k]>eps)
				p2[++cnt]=k,sum+=pro[k];
			for(int k=1;k<=n;k++)
			{
				n2=k;
				sort(p2+1,p2+1+cnt,cmp1);
				double pr3=0;
				for(int w=1,now1;w<=cnt;w=now1+1)
				{
					double mx=0;
					for(now1=w;now1<=cnt&&mp[k][p2[w]]==mp[k][p2[now1]];now1++)
						mx=max(mx,pro[p2[now1]]);
					pr3+=mx/sum;now1--;
				}
				pr2=max(pr2,pr3);
			}
			pr1+=pr2*(now-j+1)/n;
		}
		ans=max(ans,pr1);
	}
	printf("%.8lf\n",ans);
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>

using namespace std;

const int maxn = 400 + 10;
const double eps = 1e-10;

int dist[maxn][maxn];
int vis[maxn];
double po[maxn];
double maxpo[maxn];
int n, m;
int vec[maxn], vecn;
vector<int> G[maxn];

double solve(int p1, int d1) {
    vector<int> point;
    /*double num = 0;
    for(int i = 1; i <= n; i++) {
        if(dist[i][p1] == d1) {
            num++;
        }
    }*/
    memset(po, 0, sizeof(po));
    memset(vis, 0, sizeof(vis));
    memset(maxpo, 0, sizeof(maxpo));
    for(int i = 1; i <= n; i++) {
        if(dist[i][p1] == d1) {
            for(int j = 0; j < G[i].size(); j++) {
                int v = G[i][j];
                po[v] += 1.0 / n / (double)G[i].size();
                if(vis[v] == 0) {
                    vis[v] = 1;
                    point.push_back(v);
                }
            }
        }
    }
    double ans = 0;
    for(int p2 = 1; p2 <= n; p2++) {
        double t = 0;
        vecn = 0;
        for(int i = 0; i < point.size(); i++) {
            int v = point[i], d = dist[p2][v];
            if(maxpo[d] < eps) {
                vec[vecn] = d;
                vecn++;
            }
            maxpo[d] = max(maxpo[d], po[v]);
        }
        for(int i = 0; i < point.size(); i++) {
            int v = point[i], d = dist[p2][v];
            t += maxpo[d];
            maxpo[d] = 0;
        }
        for(int i = 0; i < vecn; i++) {
            maxpo[vec[i]] = 0;
        }
        ans = max(ans, t);
    }
    return ans;
}

int main() {
    //freopen("D.txt", "r", stdin);
    while(scanf("%d%d", &n, &m) != EOF) {
        for(int i = 1; i <= n; i++) G[i].clear();
        for(int i = 1; i <= n; i++) {
            for(int j = 1; j <= n; j++) {
                if(i == j) {
                    dist[i][j] = 0;
                } else {
                    dist[i][j] = n + 1;
                }
            }
        }
        for(int i = 1; i <= m; i++) {
            int a, b;
            scanf("%d%d", &a, &b);
            dist[a][b] = dist[b][a] = 1;
            G[a].push_back(b);
            G[b].push_back(a);
        }
        for(int k = 1; k <= n; k++) {
            for(int i = 1; i <= n; i++) {
                for(int j = 1; j <= n; j++) {
                    dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
                }
            }
        }
        double ans = 0;
        for(int p1 = 1; p1 <= n; p1++) {
            double t = 0;
            for(int d1 = 0;d1 <= n; d1++) {
                int flag = 0;
                for(int i = 1; i <= n; i++) {
                    if(dist[i][p1] == d1) {
                        flag = 1;
                        break;
                    }
                }
                if(flag == 0) continue;
                double tmp = 1.0 / n;
                tmp = max(tmp, solve(p1, d1));
                t += tmp;
            }
            ans = max(ans, t);
        }
        printf("%.10f\n", ans);
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef double lf;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<lf, lf> pdd;
typedef complex<lf> base;

const int inf = 987654321;
const ll INF = 123456789987654321;

#define pb push_back
#define rs resize
#define cl clear
#define all(v) (v).begin(),(v).end()

FILE *fin, *fout;

int N, M;

vector<vector<int> > adj;

vector<vector<int> > dist;

void get_dist() {
    dist = vector<vector<int> >(N, vector<int>(N, inf));

    for(int i = 0; i < N; i++) {
        dist[i][i] = 0;
        for(int j = 0; j < adj[i].size(); j++) {
            dist[i][ adj[i][j] ] = 1;
        }
    }

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            for(int k = 0; k < N; k++) {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
/*
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            cout << i << ' ' << j << ' ' << dist[i][j] << endl;
        }
    }
//*/

}

vector<vector<int> > dist_cnt;

void get_dist_cnt() {
    dist_cnt = vector<vector<int> >(N, vector<int>(N + 1, 0));
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            dist_cnt[i][ dist[i][j] ]++;
        }
    }
}

vector<int> interesting;
vector<lf> prob_interesting, dist_prob;

void solve() {

    lf maxi = 0; /// will be answer

    dist_prob = vector<lf>(N + 1, 0);

    for(int g1 = 0; g1 < N; g1++) {

        lf prob = 0;

        for(int d1 = 0; d1 <= N; d1++) {

            if(dist_cnt[g1][d1] == 0) continue;
            if(dist_cnt[g1][d1] == 1) {
                prob += (lf)dist_cnt[g1][d1] / N;
                continue;
            }

            /// get interesting
            interesting.cl();
            for(int i = 0; i < N; i++) {
                if(dist[g1][i] == d1) {
                    for(int j = 0; j < adj[i].size(); j++) {
                        int k = adj[i][j];
                        interesting.pb(k);
                    }
                }
            }
            sort(all(interesting));
            interesting.rs( unique(all(interesting)) - interesting.begin() );

            /// get prob interesting
            prob_interesting.cl(), prob_interesting = vector<lf>(interesting.size(), 0);
            for(int i = 0; i < interesting.size(); i++) {
                int o = interesting[i];
                for(int j = 0; j < adj[o].size(); j++) {
                    int oo = adj[o][j];
                    if(dist[g1][oo] == d1) prob_interesting[i] += (lf)1/adj[oo].size() * (lf)1/dist_cnt[g1][d1];
                }
            }

            lf maxi2 = 0; /// will be part ans

            for(int g2 = 0; g2 < N; g2++) {

                lf prob2 = 0;

                for(int i = 0; i < interesting.size(); i++) {
                    dist_prob[ dist[g2][ interesting[i] ] ] = max(dist_prob[ dist[g2][ interesting[i] ] ], prob_interesting[i]);
                }

                for(int i = 0; i < interesting.size(); i++) {
                    prob2 += dist_prob[ dist[g2][ interesting[i] ] ];
                    dist_prob[ dist[g2][ interesting[i] ] ] = 0;
                }

                maxi2 = max(maxi2, prob2);

                //cout << g1 << ' ' << d1 << ' ' << g2 << ' ' << maxi2 << endl;
            }
            maxi2 = max(maxi2, (lf)1/dist_cnt[g1][d1]);
            prob += (lf)dist_cnt[g1][d1]/N * maxi2;
        }
        maxi = max(maxi, prob);
    }

    printf("%.20lf", maxi);
}

int main() {
    scanf("%d %d", &N, &M);

    adj.rs(N);
    for(int i = 0; i < M; i++) {
        int u, v; scanf("%d %d", &u, &v);
        u--; v--;
        adj[u].pb(v);
        adj[v].pb(u);
    }

    get_dist();
    get_dist_cnt();
    solve();
}

#include <bits/stdc++.h>
using namespace std;

const int N = 410;

int G[N][N];
int n, m, arr[N], deg[N];
bool vis[N];
int sta[N][N], top[N];
int cl[N][N], cur;
double val[N], pos[N], cval[N][N];

int main() {
  memset(G, 0x3f, sizeof G);
  scanf("%d%d", &n, &m);
  for (int i = 1, x, y; i <= m; i ++) {
    scanf("%d%d", &x, &y);
    G[x][y] = G[y][x] = 1;
    deg[x] ++; deg[y] ++;
  }
  for (int i = 1; i <= n; i ++) G[i][i] = 0;
  for (int k = 1; k <= n; k ++)
    for (int i = 1; i <= n; i ++)
      for (int j = 1; j <= n; j ++)
        G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
  double ans = 0;
  for (int c = 1; c <= n; c ++) {
    double tot = 0;
    for (int d = 1; d <= n; d ++) {
      memset(pos, 0, sizeof pos);
      memset(vis, 0, sizeof vis);
      int top = 0, cnt = 0;
      for (int i = 1; i <= n; i ++)
        if (G[c][i] == d) {
          cnt ++;
          // only reached n times
          for (register int j = 1; j <= n; j ++)
            if (G[i][j] == 1) {
              pos[j] += 1.0 / deg[i];
              if (!vis[j]) {
                vis[j] = 1;
                arr[++ top] = j;
              }
            }
        }
      if (!cnt) break;
      double res = 0;
      cur ++;
      memset(val, 0, sizeof val);
      double p;
      for (int i = 1, k; i <= top; i ++) {
        k = arr[i]; p = pos[k];
        for (int j = 1, dd; j <= n; j ++) {
          dd = G[j][k];
          double &q = cval[j][dd];
          if (cl[j][dd] != cur) {
            cl[j][dd] = cur;
            q = p;
            val[j] += p;
          } else if (p > q) {
            val[j] = val[j] - q + p;
            q = p;
          }
        }
      }
      for (int i = 1; i <= n; i ++)
        res = max(res, val[i]);
      tot += max(res, 1.0) / n;
    }
    ans = max(ans, tot);
  }
  printf("%.10lf\n", ans + 1.0 / n);
  return 0;
}
//This Code iS suBmItted by OjsubmittEr DEVeLoPed By simphoni.

#include<bits/stdc++.h>
#define ll int
#define pb push_back
#define mp make_pair
#define ld long double
#define F first
#define S second
#define pii pair<ll,ll>

using namespace :: std;

const ll maxn=409;
const ll inf=1e9+500;

vector<ll> ger[maxn];
ll d[maxn][maxn];
ll n;
ld p[maxn];

ld ma[maxn];
ld W(const vector<ll> &vec,ll x){
    for(auto v:vec){
        ma[d[x][v]]=max(ma[d[x][v]],p[v]);
    }
    ld ans=0;
    for(auto v:vec){
        ans+=ma[d[x][v]];
        ma[d[x][v]]=0;
    }
    return ans;
}
ld Q(){
    vector<ll> vec;
    for(ll i=0;i<n;i++){
        if(p[i]>0){
            vec.pb(i);
        }
    }
    ld ans=0;
    for(ll i=0;i<n;i++){
        ans=max(ans,W(vec,i));
    }
    return ans;
}
ld g(const vector<ll> &ve){
    if(ve.size()==0){
        return 1;
    }
    else{
        fill(p,p+maxn,0);
        ld B=((ld)1/(ld)ve.size());
        for(auto v:ve){
            ld D=(B/(ld)ger[v].size());
            for(auto u:ger[v]){
                p[u]+=D;
            }
        }
        return max((ld)1/(ld)(ve.size()),Q());
    }
}

vector<ll> vec[maxn];
ld R(ll a){
    for(ll i=0;i<n;i++){
        vec[i].clear();
    }
    for(ll i=0;i<n;i++){
        vec[d[a][i]].pb(i);
    }
    ld ans=0;
    for(ll i=0;i<n;i++){
        ans+=((ld)vec[i].size()/(ld)n)*g(vec[i]);
    }
    return ans;
}

void bfs(ll a){
    for(ll i=0;i<n;i++){
        d[a][i]=inf;
    }
    queue<pii> qu;
    qu.push(mp(a,0));
    while(qu.size()){
        pii e=qu.front();
        qu.pop();
        if(d[a][e.F]==inf){
            d[a][e.F]=e.S;
            for(auto v:ger[e.F]){
                qu.push(mp(v,e.S+1));
            }
        }
    }
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    ll m;
    cin>>n>>m;
    for(ll i=0;i<m;i++){
        ll v,u;
        cin>>v>>u;
        v--;
        u--;
        ger[u].pb(v);
        ger[v].pb(u);
    }
    for(ll i=0;i<n;i++){
        bfs(i);
    }
    ld ans=0;
    for(ll i=0;i<n;i++){
        ans=max(ans,R(i));
    }
    cout<<fixed<<setprecision(10)<<ans;
}

#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define ld  double
#define ll long long
//#define int long long

using namespace std;

const int MAXN = 404 , MOD = 1e9 + 7 ;

int dis[MAXN][MAXN] , n  ;

vector<int> d[MAXN][MAXN];

vector<int> adj[MAXN] ;

ld p[MAXN][MAXN] , dp[MAXN];

inline ld inv(ld x)
{
    return 1 / x ;
}

vector < int > can [MAXN] ;

bool mark[MAXN][MAXN] ;

ld mx[MAXN] ;

inline ld check(int x)
{
    memset(p,0,sizeof p ) ;
    memset(mark,0,sizeof mark) ;
    for(int i = 0 ; i < n ; i ++ ) can[i].clear() ;
    for(int i = 0 ; i < n ; i ++ )
        for(auto u : d[x][i])
            for(auto v : adj[u]){
                p[i][v] += inv(d[x][i].size()*adj[u].size())  ;
                if(!mark[i][v])
                    can[i].pb(v) , mark[i][v] = 1 ;
            }

    for(int i = 0 ; d[x][i].size() ; i ++ )
    {
        dp[i] = inv(d[x][i].size()) ;
        for(int y = 0 ; y < n ; y ++ )
        {
            ld Ans = 0 ;
            vector< pair<int,ld> > v ;
            memset(mx,0,sizeof mx) ;
            for(auto u : can[i])
            {
                if(p[i][u]>mx[dis[y][u]])
                    Ans += p[i][u] - mx[dis[y][u]] , mx[dis[y][u]] = p[i][u] ;
            }

            dp[i] = max(dp[i],Ans) ;
        }
    }
    ld ans = 0 ;
    for(int i = 0 ; d[x][i].size() ; i ++ )
        ans += dp[i] * d[x][i].size() * inv(n) ;
    return ans ;

}

int32_t main()
{
    ios::sync_with_stdio(0) ; cin.tie(0) ;
    memset(dis,31,sizeof dis );
    int m ;
    cin >> n >> m ;
    for(int i = 0 ; i < n ; i ++ ) dis[i][i] = 0 ;
    for(int i = 0 ; i < m ; i ++ ) {int x , y ; cin >> x >> y , dis[y-1][x-1] = dis[--x][--y] = 1 ; adj[x].pb(y) ; adj[y].pb(x); }
    for(int k = 0 ; k < n ; k ++ ) for(int i = 0 ; i < n ; i ++ ) for(int j = 0 ; j < n ; j ++ )
        dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]) ;
    for(int i = 0 ; i < n ; i ++  ) for(int j = 0 ; j < n ; j ++ ) d[i][dis[i][j]].pb(j) ;
    ld ans = 0 ;
    for(int i = 0 ; i < n ; i ++ )
        ans = max(ans,check(i))  ;
    cout<<fixed<<setprecision(6)<<ans<<'\n';

}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXSIZE=30000020;
int bufpos;
char buf[MAXSIZE];
#define NEG 0
void init(){
	#ifdef LOCAL
		freopen("D.txt","r",stdin);
	#endif
	buf[fread(buf,1,MAXSIZE,stdin)]='\0';
	bufpos=0;
}
#if NEG
int readint(){
	bool isneg;
	int val=0;
	for(;!isdigit(buf[bufpos]) && buf[bufpos]!='-';bufpos++);
	bufpos+=(isneg=buf[bufpos]=='-');
	for(;isdigit(buf[bufpos]);bufpos++)
		val=val*10+buf[bufpos]-'0';
	return isneg?-val:val;
}
#else
int readint(){
	int val=0;
	for(;!isdigit(buf[bufpos]);bufpos++);
	for(;isdigit(buf[bufpos]);bufpos++)
		val=val*10+buf[bufpos]-'0';
	return val;
}
#endif
char readchar(){
	for(;isspace(buf[bufpos]);bufpos++);
	return buf[bufpos++];
}
int readstr(char* s){
	int cur=0;
	for(;isspace(buf[bufpos]);bufpos++);
	for(;!isspace(buf[bufpos]);bufpos++)
		s[cur++]=buf[bufpos];
	s[cur]='\0';
	return cur;
}
int a[402][402];
bool vis[402];
vector<int> now;
vector<int> e[402];
double cnt[402];
double tmp[402];
int main(){
	init();
	int n=readint(),m=readint();
	memset(a,0x3f,sizeof(a));
	while(m--){
		int x=readint(),y=readint();
		a[x][y]=a[y][x]=1;
		e[x].push_back(y);
		e[y].push_back(x);
	}
	for(int i=1;i<=n;i++)
		a[i][i]=0;
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				a[i][j]=min(a[i][j],a[i][k]+a[k][j]);
	double res=0;
	for(int i=1;i<=n;i++){
		double qwq=0;
		for(int j=0;j<=n;j++){
			for(int k=1;k<=n;k++)
				if (a[i][k]==j){
					for(int o : e[k]){
						if (!tmp[o])
							now.push_back(o);
						tmp[o]+=1.0/n/e[k].size();
					}
				}
			if (!now.size())
				continue;
			double ans=1.0/n;
			for(int k=1;k<=n;k++){
				double sum=0;
				for(int o : now)
					cnt[a[k][o]]=max(cnt[a[k][o]],tmp[o]);
				for(int o : now)
					sum+=cnt[a[k][o]],cnt[a[k][o]]=0;
				ans=max(ans,sum);
			}
			for(int o : now)
				tmp[o]=0;
			now.clear();
			qwq+=ans;
		}
		res=max(res,qwq);
	}
	printf("%.10f",res);
}

#include<bits/stdc++.h>
#define MAXN 405
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,m,d[MAXN][MAXN];
vector<int> G[MAXN];
bool vis[MAXN];
double p[MAXN];
double pp[MAXN];
void floyd_warshall()
{
    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
          for(int j=1;j<=n;j++) d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            d[i][j]=(i==j?0:INF);
    for(int i=0;i<m;i++)
    {
        int u,v;
        scanf("%d%d",&u,&v);
        d[u][v]=d[v][u]=1;
        G[u].push_back(v); G[v].push_back(u);
    }
    floyd_warshall();
    double ans=0.0;
    for(int i=1;i<=n;i++)
    {
        double res=0.0;
        for(int j=0;j<=n-1;j++)
        {
            vector<int> canreach,canreach2;
            for(int k=1;k<=n;k++)
                if(d[i][k]==j)
                    canreach.push_back(k);
            if(!canreach.size())continue;
            double prob=(int)canreach.size()/(double)n;
            double cur=1.0/n;
            memset(vis,false,sizeof(vis));
            memset(p,0,sizeof(p));
            for(auto v:canreach)
                for(auto to:G[v])
                {
                    if(!vis[to]) canreach2.push_back(to);
                    vis[to]=true;
                    p[to]+=1.0/(n*(int)G[v].size());
                }
            for(int k=1;k<=n;k++)
            {
                double tmp=0.0;
                for(auto to:canreach2) pp[d[k][to]]=max(pp[d[k][to]],p[to]);
                for(auto to:canreach2)
                {
                    tmp+=pp[d[k][to]];
                    pp[d[k][to]]=0.0;
                }
                cur=max(cur,tmp);
            }
            res+=cur;
        }
        ans=max(ans,res);
    }
    printf("%.10f\n",ans);
    return 0;
}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=405;
int dis[maxn][maxn];
vector<int>g[maxn];
double vis[maxn];
bool use[maxn];
vector<int>gg,gg1;
double s1[maxn];
double s2[maxn];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            dis[i][j]=dis[j][i]=100000000;
        }
    }
    for(int i=0;i<m;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        g[x].push_back(y);
        g[y].push_back(x);
        dis[x][y]=1;
        dis[y][x]=1;
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int f=1;f<=n;f++){
                dis[j][f]=min(dis[j][f],dis[j][i]+dis[i][f]);
            }
        }
    }
    double ans=0;
    for(int i=1;i<=n;i++){
        double aa=1.0/n;
        for(int j=1;j<=n;j++){
            for(int f=1;f<=n;f++){
                vis[f]=0;
                use[f]=0;
            }
            gg.clear();
            int q=0;
            for(int f=1;f<=n;f++){
                if(dis[i][f]==j){
                    int p=g[f].size();
                    for(int v:g[f]){
                        if(!use[v]){
                            gg.push_back(v);
                        }
                        vis[v]+=1.0/p*1.0/n;
                        use[v]=1;
                    }
                    q++;
                }
            }
            if(gg.size()==0) continue;
            memset(use,0,sizeof(use));
            double ans1=1.0/n;
            for(int f=1;f<=n;f++){
                double s=0;
                for(int v:gg){
                    if(!use[dis[f][v]]){
                        use[dis[f][v]]=1;
                        gg1.push_back(dis[f][v]);
                    }
                    s2[dis[f][v]]=max(s2[dis[f][v]],vis[v]);
                }
                for(int v:gg1){
                    double p;
                    p=s2[v];
                    s+=p;
                    s2[v]=0;
                    use[v]=0;
                }
                gg1.clear();
                ans1=max(ans1,s);
            }
            aa+=ans1;
        }
        aa=aa;
        ans=max(ans,aa);
    }
    printf("%.10lf\n",ans);
}

#pragma comment(linker, "/STACK:102400000,102400000")
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#define LL long long
using namespace std;
const int M = 405, INF = 0x3f3f3f3f;
vector<int>edge[M];
int mp[M][M];
bool mark[M];
double B[M],C[M];
double solve(int n,int g1,int dis){
    vector<int>A;
    double ans=0;
    for(int j=1;j<=n;j++){
        mark[j]=0;
        B[j]=0;
    }
    for(int j=1;j<=n;j++){
        if(mp[g1][j]==dis){
            for(int k:edge[j]){
                B[k]+=1.0/n/edge[j].size();
                if(!mark[k]){
                    mark[k]=1;
                    A.push_back(k);
                }
            }
        }
    }
    for(int g2=1;g2<=n;g2++){
        double sum=0;
        for(int x:A){
            //printf("%d %f\n",x,B[x]);
            C[mp[g2][x]]=max(C[mp[g2][x]],B[x]);
        }
        //printf("\n");
        for(int x:A){
            //printf("%d %d %d %f\n",g2,x,mp[g2][x],C[mp[g2][x]]);
            sum+=C[mp[g2][x]];
            C[mp[g2][x]]=0;
        }
        //printf("%f\n--------\n",sum);
        ans=max(ans,sum);
    }
    return ans;
}
int main() {
    int n,m;
    scanf("%d%d",&n,&m);
    memset(mp,63,sizeof(mp));
    for(int j=1;j<=n;j++) mp[j][j]=0;
    for(int j=1;j<=m;j++){
        int a,b;
        scanf("%d%d",&a,&b);
        edge[a].push_back(b);
        edge[b].push_back(a);
        mp[a][b]=mp[b][a]=1;
    }
    for(int j=1;j<=n;j++){
        for(int k=1;k<=n;k++){
            for(int i=1;i<=n;i++){
                mp[k][i]=min(mp[k][i],mp[k][j]+mp[j][i]);
            }
        }
    }
    //printf("%d\n",mp[2][4]);
    double ans=0;
    for(int g1=1;g1<=n;g1++){
        double sum=0;
        for(int dis=0;dis<=n;dis++){
            int cnt=0;
            for(int j=1;j<=n;j++){
                if(mp[g1][j]==dis) cnt++;
            }
            if(cnt==0) continue;
            double a=solve(n,g1,dis);
            //printf("%f\n",a);
            sum+=max(1.0/n,a);
        }
        ans=max(ans,sum);
    }
    printf("%f\n",ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 1010;

int dis[N][N];
vector<int> w[N];
double p_later[N];
double p_dis_max[N];
bool vis[N];

void updmax(double &x, double y) {
  x = max(x, y);
}

double consider_tomorrow(int n, int g1, int dis1) {
  double best = 0;
  for (int i = 1; i <= n; ++i) {
    p_later[i] = 0;
    vis[i] = 0;
  }
  vector<int> interesting;
  for (int v = 1; v <= n; ++v) if (dis[g1][v] == dis1) {
    for (int b : w[v]) {
      p_later[b] += 1. / n / w[v].size();
      if (!vis[b]) {
        vis[b] = 1;
        interesting.push_back(b);
      }
    }
  }
  //for (int i = 1; i <= n; ++i) printf("%f ", p_later[i]); puts("");
  for (int g2 = 1; g2 <= n; ++g2) {
    double local_sum = 0;
    for (int b : interesting) {
      updmax(p_dis_max[dis[g2][b]], p_later[b]);
    }
    for (int b : interesting) {
      local_sum += p_dis_max[dis[g2][b]];
      p_dis_max[dis[g2][b]] = 0;
    }
    updmax(best, local_sum);
  }
  return best;
}

int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) for (int j = 1; j <= n; ++j) if (i != j) dis[i][j] = n + 1;
  for (int i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    w[a].push_back(b);
    w[b].push_back(a);
    dis[a][b] = dis[b][a] = 1;
  }
  for (int k = 1; k <= n; ++k)
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
  double ans = 0;
  for (int g1 = 1; g1 <= n; ++g1) {
    double sum_over_dis1 = 0;
    for (int dis1 = 0; dis1 <= n; ++dis1) {
      int cnt_cities = 0;
      for (int i = 1; i <= n; ++i) if (dis[g1][i] == dis1)
        ++cnt_cities;
      if (cnt_cities == 0) continue;
      double immediatly = 1. / n;
      double second_day = consider_tomorrow(n, g1, dis1);
      sum_over_dis1 += max(immediatly, second_day);
    }
    updmax(ans, sum_over_dis1);
  }
  printf("%.12f\n", ans);
  return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#define maxn 405
using namespace std;
int n,m;
int g[maxn][maxn];
vector <int> v[maxn];
double ans;
double gai[maxn];
double pos[maxn];
double suan(int yi,int juli)
{
	memset(gai,0,sizeof(gai));
	for(int i=1;i<=n;i++)
	{
		if(g[i][yi]==juli)
		{
			for(int j=0;j<(int)v[i].size();j++)
			{
				gai[v[i][j]]+=1.0/n/(int)v[i].size();
			}
		}
	}
	vector <int> r;
	r.clear();
	for(int i=1;i<=n;i++)if(gai[i])r.push_back(i);
	double ret=0;
	for(int i=1;i<=n;i++)
	{
		double tmp=0;
		for(int j=0;j<(int)r.size();j++)
		{
			pos[g[i][r[j]]]=max(pos[g[i][r[j]]],gai[r[j]]);
		}
		for(int j=0;j<(int)r.size();j++)
		{
			tmp+=pos[g[i][r[j]]];
			pos[g[i][r[j]]]=0;
		}
		ret=max(ret,tmp);
	}
	return ret;
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		if(i!=j)g[i][j]=199912310;
	}
	for(int i=1;i<=m;i++)
	{
		int x,y,z;
		scanf("%d%d",&x,&y);
		g[x][y]=1;
		g[y][x]=1;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	for(int k=1;k<=n;k++)
	{
		for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			g[i][j]=g[j][i]=min(g[i][j],g[i][k]+g[k][j]);
		}
	}
/*for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		cout<<i<<" "<<j<<" "<<g[i][j]<<endl;
	}*/
	for(int i=1;i<=n;i++)
	{
		double now=0;
		for(int dist=0;dist<n;dist++)
		{
			int cnt=0;
			for(int j=1;j<=n;j++)
			{
				if(g[i][j]==dist)cnt++;
			}
			//if(i==4)cout<<dist<<" "<<cnt<<endl;
			if(!cnt)continue;
			double p=1.0/n;
			double q=suan(i,dist);
		//	if(i==4)cout<<p<<" "<<q<<endl;
			now+=max(p,q);
		}
		//cout<<i<<" "<<now<<endl;
		ans=max(ans,now);
	}
	printf("%.8lf\n",ans);
	return 0;
}

// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
const int N = 405, mod = 0;

int d[N][N], mat[N][N], deg[N];
double cnt[N][N];
double go[N][N], val[N], cur[N][N], sum[N];;
vector<int> p[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N; ++j)
            if (i != j)
                d[i][j] = 1e9;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        --u, --v;
        deg[u]++; deg[v]++;
        d[u][v] = d[v][u] = mat[u][v] = mat[v][u] = 1;
    }
    for (int k = 0; k < n; ++k)
        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    double best = 0;
    for (int st = 0; st < n; ++st) {
        double res = 0;
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < N; ++j)
                go[i][j] = 0;
            p[i].clear();
        }

        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j) if (mat[i][j])
                go[i][d[st][j]] += (double) 1 / (deg[j] * 1ll * n);
        for (int i = 0; i < n; ++i) {
            p[d[st][i]].push_back(i);
        }
        for (int dis = 0; dis <= n; ++dis) {
            if (p[dis].size() <= 1) {
                res += (double) p[dis].size() / n;
                continue;
            }
            double mx = 0;
            vector<pair<int, int>> c;
            for (int see = dis - 1; see <= dis + 1; ++see) if (see >= 0) {
                for (int v : p[see])
                    for (int u = 0; u < n; ++u) {
                 //       val[u] -= cur[u][d[u][v]];
           //             cnt[u][d[u][v]] += go[v][dis];
                        sum[u] += go[v][dis];
                        cur[u][d[u][v]] = max(cur[u][d[u][v]], go[v][dis]);
                        c.push_back(make_pair(u, d[u][v]));
               //         val[u] += cur[u][d[u][v]];
                    }

            }
            for (pair<int, int> x : c) {
                int u = x.first;
                if (cur[x.first][x.second] != 0) {
                    val[u] += cur[x.first][x.second] / sum[u];
                //    cout << sum[u] << endl;
                }
                cur[x.first][x.second] = 0;
         //       cnt[x.first][x.second] = 0;
            }
            for (int v = 0; v < n; ++v) {
                mx = max(mx, val[v]);
              //  cout << st << ' ' << v << ' ' << val[v] << endl;
                sum[v] = 0;
                val[v] = 0;
            }
            res += max((double) 1, mx * (double) p[dis].size()) / n;
        }
   //     cout << st << ' ' << res << endl;
        best = max(res, best);
    }
    cout << setprecision(10) << fixed << best << endl;
}

/*
  ------------------------- Hachiikung ---------------------------------
  ---------------------- Worrachate Bosri ------------------------------
  ------ Faculty of Computer Engineering Chulalongkorn University ------
*/
#include <bits/stdc++.h>
using namespace std;
#define REP(i,FN) for(int i=0;i<FN;i++)
#define FOR(i,ST,FN) for(int i=ST;i<=FN;i++)
#define FORD(i,FN,ST) for(int i=FN;i>=ST;i--)
#define FORX(i,c) for(typeof(c.begin())i=c.begin();i!=c.end();i++)
#define pause system("pause")
#define S scanf
#define P printf
#define X first
#define Y second
#define pb push_back
#define PII pair<int,int>
#define mp make_pair
#define sz size()
#define eps 1e-8

const int MOD(1000000007);
const int INF((1<<30)-1);
const int MAXN(405);

vector<int>a[MAXN];

int d[MAXN][MAXN], c[MAXN];

double p[MAXN], pmax[MAXN];

int main(){

    int n,m;
    S("%d%d",&n,&m);

    FOR(i,1,n)
        FOR(j,1,n)
        {
            if(i == j) d[i][j] = 0;
            else d[i][j] = INF;
        }

    REP(i,m)
    {
        int u,v;
        S("%d%d",&u,&v);
        a[u].pb(v);
        a[v].pb(u);
        d[u][v] = d[v][u] = 1;
    }

    FOR(k,1,n)
        FOR(i,1,n)
            FOR(j,1,n)
                d[i][j] = min(d[i][j], d[i][k]+d[k][j]);

    double ans = 0.0;

    FOR(i,1,n)
    {
        double t1 = 0.0, t2 ,t3;

        FOR(dist,0,n-1)
        {
            vector<int>b;

            FOR(j,1,n)
            {
                c[j] = 0;
                p[j] = 0.0;
            }

            FOR(j,1,n)
            {
                if(d[i][j] == dist)
                {
                    REP(k,a[j].sz)
                    {
                        int u = a[j][k];
                        p[u] += 1.0/n/a[j].sz;
                        if(!c[u])
                        {
                            b.pb(u);
                            c[u] = 1;
                        }
                    }
                }
            }

            if(b.sz == 0) continue;

            t2 = 0.0;

            FOR(k,1,n)
            {
                REP(j,b.sz)
                {
                    int u = b[j];
                    pmax[d[k][u]] = max(pmax[d[k][u]], p[u]);
                }

                t3 = 0.0;

                REP(j,b.sz)
                {
                    int u = b[j];
                    t3 += pmax[d[k][u]];
                    pmax[d[k][u]] = 0.0;
                }

                t2 = max(t2, t3);

            }

            t1 += max(1.0/n, t2);

        }

        ans = max(ans, t1);

    }

    P("%.10lf",ans);

}

#include<bits/stdc++.h>
using namespace std;
int dis[505][505],q[505];
double b[505],c[505];
int n,m,x,y;
double ans;
int main(){
	scanf("%d%d",&n,&m);
	memset(dis,1,sizeof(dis));
	for (int i=1;i<=n;i++) dis[i][i]=0;
	for (int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		dis[x][y]=dis[y][x]=1;
	}
	for (int k=1;k<=n;k++)
		for (int i=1;i<=n;i++)
			for (int j=1;j<=n;j++)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for (int i=1;i<=n;i++){
		double r=0;
		for (int j=0;j<n;j++){
			int u=0,p=0; double t=0;
			memset(b,0,sizeof(b));
			for (int k=1;k<=n;k++)
				if (dis[i][k]==j){
					int v=0; u++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) v++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) b[l]+=1.0/v;
				}
			for (int k=1;k<=n;k++)
				if (abs(dis[i][k]-j)<=1)
					q[++p]=k;
			for (int k=1;k<=n;k++){
				double w=0;
				for (int l=1;l<=p;l++)
					if (b[q[l]]>c[dis[k][q[l]]])
						c[dis[k][q[l]]]=b[q[l]];
				for (int l=1;l<=p;l++)
					w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				t=max(t,w);
			}
			if (t>u+1) puts("!!!");
			if (u) t=max(t,1.0);
			r+=t/n;

		}
		ans=max(ans,r);
	}
	printf("%.12lf\n",ans);
}

#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF (1<<29)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<"  "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define IN(n) int n;scanf("%d",&n);
#define FOR(i, m, n) for (int i(m); i < n; i++)
#define F(n) FOR(i,0,n)
#define FF(n) FOR(j,0,n)
#define FT(m, n) FOR(k, m, n)
#define aa first
#define bb second
void ga(int N,int *A){F(N)scanf("%d",A+i);}
#define MX (404)
bitset<MX> r;
vi G[MX],D[MX][MX],R;
int g[MX][MX],N,M,a,b;
double X,z[MX],B[MX];
double sol(int I,vi&d){
    double p=0;
    for(auto&h:R)B[g[I][h]]=0;
    for(auto&h:R)if(B[g[I][h]]<z[h])p+=z[h]-B[g[I][h]],B[g[I][h]]=z[h];
    return p;
}
double tst(vi&d){
    if(d.size()<2u)return 0;//FS
    r.reset(),R.clear();
    double X=0;
    F(N)z[i]=0;
    for(auto&u:d)for(auto&h:G[u]){
        z[h]+=1./d.size()/G[u].size();
        if(!r[h])R.PB(h),r[h]=1;
    }
    F(N)X=max(X,sol(i,d));
    return X;
}
double go(int I){
    double p=0;
    for(auto&h:D[I])if(!h.empty())p+=max(1./N,tst(h)*h.size()/N);
    return p;
}
int main(void){
    scanf("%d%d",&N,&M);
    F(N)FF(N)g[i][j]=i^j?INF-1:0;//init
    F(M)scanf("%d%d",&a,&b),G[--a].PB(--b),G[b].PB(a),g[a][b]=g[b][a]=1;
    FT(0,N)F(N)FF(N)g[i][j]=min(g[i][j],g[i][k]+g[k][j]);//FW
    F(N)FF(N)D[i][g[i][j]].PB(j);
    F(N)X=max(X,go(i));
    printf("%.10lf\n",X);
    return 0;
}

#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

const int N = 402;
const int INF = 1e9;

int n, m, d[N][N];
vector<int> g[N];

template<typename T>
void Maximize(T &a, T b) {if (a < b) a = b;}

void Floyd()                      // because it's shorter
{
    for (int i = 1; i <= n; ++i) d[i][i] = 0;
    for (int k = 1; k <= n; ++k)
        for (int i = 1; i <= n; ++i)
            for (int j = 1; j <= n; ++j)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}

double Cal(int p1, int d1)
{
    vector<int> a;
    vector<bool> vst(n+1, false);
    vector<double> prob(n+1, 0);      // probability Limak will be there in the 2nd day
    for (int u = 1; u <= n; ++u)
        if (d[p1][u] == d1)
            for (int v: g[u])
            {
                if (!vst[v]) a.push_back(v), vst[v] = true;
                prob[v] += 1.0 / n / g[u].size();
            }

    vector<double> mxprob(n+1, 0);    // for each d2, p3 will be the city with maximum probability
    double res = 0;
    for (int p2 = 1; p2 <= n; ++p2)
    {
        double local = 0;             // answer for this p2
        for (int v: a) Maximize(mxprob[d[p2][v]], prob[v]);
        for (int v: a)
        {
            local += mxprob[d[p2][v]];
            mxprob[d[p2][v]] = 0;      // so it is not counted twice
        }
        Maximize(res, local);
    }
    return res;
}

void Solve()
{
    Floyd();
    double res = 0;
    for (int p1 = 1; p1 <= n; ++p1)
    {
        double local = 0;               // answer for this p1
        for (int d1 = 0; d1 <= n; ++d1)
        {
            int cnt = 0;
            for (int i = 1; i <= n; ++i) cnt += d[p1][i] == d1;
            if (!cnt) continue;
            double immediate = 1.0 / n;        // result if guess one of cnt vertices immediately (1.0 / cnt * cnt / n == 1.0 / n)
            double tomorrow = Cal(p1, d1);     // result if wait till tomorrow
            local += max(immediate, tomorrow);
        }
        Maximize(res, local);
    }
    printf("%.6f",res);
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
        fill(d[i]+1, d[i]+1+n, INF);
    for (int i = 0, u, v; i < m; ++i)
    {
        scanf("%d%d", &u, &v);
        d[u][v] = d[v][u] = 1;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    Solve();
    return 0;
}

#include<bits/stdc++.h>
#define ALL(X)        X.begin(),X.end()
#define FOR(I,A,B)    for(int (I) = (A); (I) <= (B); (I)++)
#define FORW(I,A,B)   for(int (I) = (A); (I) < (B);  (I)++)
#define FORD(I,A,B)   for(int (I) = (A); (I) >= (B); (I)--)
#define FOREACH(I,A)  for(__typeof(A.begin()) I = A.begin(); I != A.end(); ++I)
#define CLEAR(X)      memset(X,0,sizeof(X))
#define SIZE(X)       int(X.size())
#define CONTAIN(A,X)  (A.find(X) != A.end())
#define PB            push_back
#define MP            make_pair
#define X             first
#define Y             second

using namespace std;

template<typename T, typename U> ostream& operator << (ostream& os, const pair<T,U>&p) { return os << "(" << p.X << "," << p.Y << ")"; }
template<typename T> ostream& operator << (ostream &os, const vector<T>& V) { os << "["; FORW(i,0,SIZE(V)) os << V[i] << ((i==SIZE(V)-1) ? "" : ","); return os << "]"; }
template<typename T> ostream& operator << (ostream &os, const set<T>& S) {os << "("; FOREACH(i,S) os << *i << (*i==*S.rbegin()?"":","); return os << ")"; }
template<typename T, typename U> ostream& operator << (ostream &os, const map<T, U>& M){os << "{"; FOREACH(i,M) os << *i << (*i.X==M.rbegin()->X?"":","); return os << "}"; }

typedef signed long long slong;
typedef long double ldouble;
const slong Infinity = 1000000100;
const ldouble Epsilon = 1e-9;

vector<int> V[404];

vector<int> L[404];

int D[404][404];
int n,m;

int cd(int a){
	queue<int> Q;
	Q.push(a);
	D[a][a] = 1;
	while(!Q.empty()){
		int u = Q.front(); Q.pop();
		for(int v : V[u]) if(D[a][v] == 0){
			D[a][v] = D[a][u]+1;
			Q.push(v);
		}
	}
	FOR(i,1,n) D[a][i]--;
}

void dist(){
	FOR(i,1,n) cd(i);
}

map<vector<int>,ldouble> M;

ldouble P[404];
int Kt[404];
int T;

ldouble L2[404];
int Kt2[404];
int T2;

ldouble str2(vector<int> L){
	if(M[L] != 0 or SIZE(L) == 0) return M[L];
	T++;
	vector<int> NL;
	for(int l : L){
		for(int v : V[l]){
			if(Kt[v] != T){
				Kt[v] = T;
				P[v] = 0;
				NL.PB(v);
			}
			P[v] += 1.0/n/SIZE(V[l]);
		}
	}
	ldouble ans =  1.0 / n;
	const ldouble zz = 0;
	FOR(i,1,n){
		T2++;
		ldouble tmans = 0;
		for(int nl : NL){
			if(Kt2[D[i][nl]] != T2){
				Kt2[D[i][nl]] = T2;
				L2[D[i][nl]] = 0;
			}
			tmans += max( zz , P[nl]-L2[D[i][nl]]);
			L2[D[i][nl]] = max(L2[D[i][nl]], P[nl]);
		}
		ans = max(ans,tmans);
	}
	//cout << L <<" " <<  ans << endl;
	M[L] = ans;
	return ans;
}

ldouble str1(int a){
	ldouble ans = 1.0/n;
	FOR(i,0,n){
		L[i].clear();
	}
	FOR(i,1,n){
		L[D[a][i]].PB(i);
	}
	FOR(i,1,n){
		ans += str2(L[i]);
	}
	return ans;
}

int main(){
	scanf("%d%d",&n,&m);
	FOR(i,1,m){
		int a,b;
		scanf("%d%d",&a,&b);
		V[a].PB(b);
		V[b].PB(a);
	}
	dist();
	ldouble ans = 0;
	FOR(i,1,n){
		ans = max(ans, str1(i));
	}
	cout << setprecision(30) << fixed << ans;
}

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;
using namespace std;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜

#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define rof(i,a,b) for(int (i)=(a);(i) > (b); --(i))
#define rep(i, c) for(auto &(i) : (c))
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define PB pop_back()
#define iOS ios_base::sync_with_stdio(false)
#define sqr(a) (((a) * (a)))
#define all(a) a.begin() , a.end()
#define error(x) cerr << #x << " = " << (x) <<endl
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";
#define Error3(a,b,c) cerr<<"("<<#a<<" , "<<#b<<" , "<<#c<<" ) = ( "<<(a)<<" , "<<(b)<<" , "<<(c)<<")\n";
#define Error4(a,b,c,d) cerr<<"("<<#a<<" , "<<#b<<" , "<<#c<<" , "<<#d<<" ) = ( "<<(a)<<" , "<<(b)<<" , "<<(c)<<" , "<<(d)<<")\n";
#define Error5(a,b,c,d,e) cerr<<"("<<#a<<" , "<<#b<<" , "<<#c<<" , "<<#d<<" , "<<#e<<" ) = ( "<<(a)<<" , "<<(b)<<" , "<<(c)<<" , "<<(d)<<" , "<<(e)<<")\n";
#define errop(a) cerr<<#a<<" = ( "<<((a).x)<<" , "<<((a).y)<<" )\n";
#define coud(a,b) cout<<fixed << setprecision((b)) << (a)
#define L(x) (((x)<<1)+1)
#define R(x) (((x)<<1)+2)
#define umap unordered_map
//#define double long double
#define mod 1000000007
#define mod1 1000000009
#define LIMIT 10000000000000000LL
#define INF 10000000000LL
#define MAX1 1000000000
const int inf=0x3f3f3f3f;
const long double pi=acos(-1.0);
#define MAX 50010
// #define N 100010
const string debug_line="yolo";
#define debug error(debug_line)
#define read() freopen("mergedoutput.txt","r",stdin)
#define write() freopen("output.txt","w",stdout)
//template <typename T> using os =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long ll;
typedef pair<int,int>pii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef complex <long double> complex_t;
const long double PI = acos((long double)-1.0);
const long double eps=1e-6;
ull getRand(){return ((ull)rand()<<40)+((ull)rand()<<20)+((ull)rand());}

int dist[410][410];
vi Adj[410];
double p_later[410];
double p_max_dis[410];
bool visited[410];
int n,m;

double takeTomorow(int city,int dis){
	For(i,1,n+1){
		p_later[i]=0;
		visited[i]=false;
	}
	vi interesting;
	For(i,1,n+1){
		if(dist[city][i]==dis){
			rep(t1,Adj[i]){
				if(!visited[t1]){
					visited[t1]=true;
					interesting.pb(t1);
				}
				p_later[t1]+=(1.0/(1.0*n)/(double)Adj[i].size());
			}
		}
	}

	double maxTomorrow=0;
	For(city2,1,n+1){
		double local_sum=0;
		rep(t1,interesting){
			p_max_dis[dist[city2][t1]]=max(p_max_dis[dist[city2][t1]],p_later[t1]);
		}
		rep(t1,interesting){
			local_sum+=p_max_dis[dist[city2][t1]];
			p_max_dis[dist[city2][t1]]=0;
		}
		maxTomorrow=max(maxTomorrow,local_sum);
	}
	return maxTomorrow;
}

int main(){
	scanf("%d%d",&n,&m);

	For(i,0,n+1){
		For(j,0,n+1){
			dist[i][j]=10e8;
		}
	}

	For(i,1,n+1){
		dist[i][i]=0;
	}

	For(i,0,m){
		int a1,b1;
		scanf("%d%d",&a1,&b1);
		Adj[a1].pb(b1);Adj[b1].pb(a1);
		dist[a1][b1]=dist[b1][a1]=1;
	}

	For(k,1,n+1){
		For(i,1,n+1){
			For(j,1,n+1){
				dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
			}
		}
	}

	double answer1=0;
	For(city1,1,n+1){
		double sumOverDist=0;
		For(dis,0,n){
			int cntCities=0;
			For(city2,1,n+1){
				if(dist[city1][city2]==dis){
					cntCities++;
				}
			}
			if(cntCities==0){
				continue;
			}
			else{
				double guessNow=1.0/(1.0*n);
				double guessLater=takeTomorow(city1,dis);
				sumOverDist=sumOverDist+max(guessNow,guessLater);
			}
		}
		answer1=max(answer1,sumOverDist);
	}

	printf("%.12lf\n",answer1);
return 0;}

#include <bits/stdc++.h>
using namespace std;
#define N 410
#define eps 1e-9
int n,m,n1,cnt,n2;
int mp[N][N],mp1[N][N];
int p1[N],du[N],p2[N];
double pro[N],ans;
int cmp(int x,int y)
{return mp[n1][x]<mp[n1][y];}
int cmp1(int x,int y)
{return mp[n2][x]<mp[n2][y];}
int main()
{
	//freopen("tt.in","r",stdin);
	scanf("%d%d",&n,&m);
	memset(mp,0x3f,sizeof(mp));
	for(int i=1,x,y;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		du[x]++;du[y]++;
		mp[x][y]=mp[y][x]=1;
		mp1[x][y]=mp1[y][x]=1;
	}
	for(int i=1;i<=n;i++)mp[i][i]=0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			for(int k=1;k<=n;k++)
				mp[j][k]=min(mp[j][k],mp[j][i]+mp[i][k]);
	for(int i=1;i<=n;i++)
	{
		n1=i;
		for(int j=1;j<=n;j++)p1[j]=j;
		sort(p1+1,p1+1+n,cmp);
		double pr1=0;
		for(int j=1,now;j<=n;j=now+1)
		{
			for(now=j;now<=n&&mp[i][p1[j]]==mp[i][p1[now]];now++);now--;
			double pr2=1.0/(now-j+1),sum=0;
			memset(pro,0,sizeof(pro));
			for(int k=j;k<=now;k++)
				for(int w=1;w<=n;w++)if(mp1[p1[k]][w])
					pro[w]+=1.0/du[p1[k]];
			cnt=0;
			for(int k=1;k<=n;k++)if(pro[k]>eps)
				p2[++cnt]=k,sum+=pro[k];
			for(int k=1;k<=n;k++)
			{
				n2=k;
				sort(p2+1,p2+1+cnt,cmp1);
				double pr3=0;
				for(int w=1,now1;w<=cnt;w=now1+1)
				{
					double mx=0;
					for(now1=w;now1<=cnt&&mp[k][p2[w]]==mp[k][p2[now1]];now1++)
						mx=max(mx,pro[p2[now1]]);
					pr3+=mx/sum;now1--;
				}
				pr2=max(pr2,pr3);
			}
			pr1+=pr2*(now-j+1)/n;
		}
		ans=max(ans,pr1);
	}
	printf("%.8lf\n",ans);
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=405;
int f[N][N],q[N],n,m;
double ans,b[N],c[N];
int main(){
	scanf("%d%d",&n,&m);
	For(i,1,n) For(j,1,n)
		f[i][j]=(i==j?0:1<<20);
	For(i,1,m){
		int x,y;
		scanf("%d%d",&x,&y);
		f[x][y]=f[y][x]=1;
	}
	For(k,1,n) For(i,1,n) For(j,1,n)
		f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	For(i,1,n){
		double val=0;
		For(j,0,n-1){
			double mxv=0;
			For(k,1,n) b[k]=0;
			For(k,1,n) if (f[i][k]==j){
				mxv=1; int sum=0;
				For(l,1,n) if (f[k][l]==1) ++sum;
				For(l,1,n) if (f[k][l]==1) b[l]+=1.0/sum;
			}
			*q=0;
			For(k,1,n)
				if (fabs(f[i][k]-j)<=1)
					q[++*q]=k;
			For(k,1,n){
				double sum=0;
				For(l,1,*q)
					if (b[q[l]]>c[f[k][q[l]]]){
						sum-=c[f[k][q[l]]];
						sum+=(c[f[k][q[l]]]=b[q[l]]);
					}
				mxv=max(mxv,sum);
				For(l,1,*q)
					c[f[k][q[l]]]=0;
			}
			val+=mxv;
		}
		ans=max(ans,val/n);
	}
	printf("%.10lf\n",ans);
}

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
typedef double T;
const int nax = 1005;
int dist[nax][nax];
vector<int> w[nax];
T p_later[nax]; // p[v] - probability for city v in the second day
T p_dist_max[nax];
bool vis[nax];

void max_self(T & a, T b) {
	a = max(a, b);
}

T consider_tomorrow(int n, int g1, int dist1) {
	T best_tomorrow = 0;
	// we need complexity O(n * x)
	// where x denotes the number of v that |dist1-dist[g1][v]| <= 1
	for(int i = 1; i <= n; ++i) {
		p_later[i] = 0;
		vis[i] = false;
	}
	vector<int> interesting;
	for(int v = 1; v <= n; ++v) if(dist[g1][v] == dist1)
		for(int b : w[v]) {
			// Limak started in v with prob. 1/n
			// he then moved to b with prob. 1/degree[v]
			p_later[b] += (T) 1 / n / w[v].size();
			if(!vis[b]) {
				vis[b] = true;
				interesting.push_back(b);
			}
		}

	// interesting.size() <= x, where x is defined above (needed for complexity)
	for(int g2 = 1; g2 <= n; ++g2) {
		T local_sum = 0; // over situations with fixed g1, dist1, g2

		for(int b : interesting)
			max_self(p_dist_max[dist[g2][b]], p_later[b]);
		for(int b : interesting) {
			local_sum += p_dist_max[dist[g2][b]];
			p_dist_max[dist[g2][b]] = 0; // so it won't be calculated twice
		}
		max_self(best_tomorrow, local_sum);
	}
	return best_tomorrow;
}

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	FOR(i,1,n) FOR(j, 1, n) if(i != j)
		dist[i][j] = n + 1; // infinity
	FOR(i,1,m) {
		int a, b;
		scanf("%d%d", &a, &b);
		w[a].push_back(b);
		w[b].push_back(a);
		dist[a][b] = dist[b][a] = 1;
	}
	// Floyd-Warshall
	FOR(b,1,n)FOR(a,1,n)FOR(c,1,n)
		dist[a][c] = min(dist[a][c], dist[a][b] + dist[b][c]);

	// g1 is the first guess
	T answer = 0;
	FOR(g1, 1, n) {
		T sum_over_dist1 = 0;
		FOR(dist1, 0, n) {
			int cnt_cities = 0;
			FOR(i, 1, n) if(dist[g1][i] == dist1)
				++cnt_cities;
			if(cnt_cities == 0) continue; // there are no cities within distance dist1

			// 1) consider guessing immediately
			T immediately = (T) 1 / n; // how much it counts towards the answer
			// 2) consider waiting for tomorrow
			T second_day = consider_tomorrow(n, g1, dist1);
			sum_over_dist1 += max(immediately, second_day);
		}
		max_self(answer, sum_over_dist1);
	}
	printf("%.12lf\n", (double) answer);
	return 0;
}

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sz(s) ((int) ((s).size()))
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

#ifdef _WIN32
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif

typedef long long ll;
typedef long double ld;

const int inf = (int) 1e9 + 100;
const ld eps = 1e-11;
const ld pi = acos(-1.0L);

mt19937 mrand(random_device{} ());
int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = 410;
int n, m;
vector<vector<int> > graph;

bool read() {
  if (scanf("%d%d", &n, &m) < 2) {
    return false;
  }
  graph = vector<vector<int> > (n);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    graph[a].pb(b);
    graph[b].pb(a);
  }
  return true;
}

vector<int> ondist[maxn][maxn];
int maxdist[maxn];

ld ans[maxn][maxn];
int cols[maxn][maxn];

ld vals[maxn];
int good[maxn], cntgood;

ld mx[maxn];

void solve() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ondist[i][j].clear();
    }
    queue<int> q;
    vector<int> dist(n, inf);
    q.push(i);
    dist[i] = 0;
    while (sz(q)) {
      int cur = q.front();
      q.pop();
      for (int k = 0; k < sz(graph[cur]); k++) {
        int to = graph[cur][k];
        if (dist[to] == inf) {
          dist[to] = dist[cur] + 1;
          q.push(to);
        }
      }
    }
    maxdist[i] = 0;
    for (int j = 0; j < n; j++) {
      ondist[i][dist[j]].pb(j);
      cols[i][j] = dist[j];
      maxdist[i] = max(maxdist[i], dist[j]);
    }
    for (int j = 0; j <= maxdist[i] ; j++) {
      ans[i][j] = (ld) 1 / n;
    }
  }
  memset(vals, 0, sizeof(vals));
  memset(mx, 0, sizeof(mx));
  for (int fs = 0; fs < n; fs++) {
    for (int dist1 = 0; dist1 <= maxdist[fs]; dist1++) {
      for (auto i : ondist[fs][dist1]) {
        for (auto j : graph[i]) {
          vals[j] += (ld) 1 / n / sz(graph[i]);
        }
      }
      /*for (int i = 0; i < n; i++) {
        eprintf("%.18f%c", (double) vals[i], " \n"[i == n - 1]);
      }*/
      cntgood = 0;
      for (int dist = max(0, dist1 - 1); dist <= min(dist1 + 1, maxdist[fs]); dist++) {
        for (auto i : ondist[fs][dist]) {
          good[cntgood++] = i;
        }
      }
      for (int sec = 0; sec < n; sec++) {
        ld curans = 0;
        for (int i = 0; i < cntgood; i++) {
          int cur = cols[sec][good[i]];
          mx[cur] = max(mx[cur], vals[good[i]]);
        }
        for (int i = 0; i < cntgood; i++) {
          int cur = cols[sec][good[i]];
          curans += mx[cur];
          mx[cur] = 0;
        }
        ans[fs][dist1] = max(ans[fs][dist1], curans);
      }
      for (auto i : ondist[fs][dist1]) {
        for (auto j : graph[i]) {
          vals[j] = 0;
        }
      }
    }
  }
  ld res = 0;
  for (int i = 0; i < n; i++) {
    ld curres = 0;
    for (int j = 0; j <= maxdist[i]; j++) {
      //eprintf("%.18f%c", (double) ans[i][j], " \n"[j == maxdist[i]]);
      curres += ans[i][j];
    }
    res = max(res, curres);
  }
  printf("%.18f\n", (double) res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen("text.in", "r", stdin));
  assert(freopen("text.out", "w", stdout));
#endif

  while (true) {
    if (!read()) {
      break;
    }
    solve();
#ifdef DEBUG
    eprintf("Time: %.18f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}

#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef long double ld;

const int Maxn = 405;
const int Inf = 1000000000;

int n, m;
int dist[Maxn][Maxn];
vector <int> V[Maxn];
ld prob[Maxn], mx[Maxn];
ld res;
int seq[Maxn], slen;
int bseq[Maxn], blen;

int main()
{
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			dist[i][j] = (i != j) * Inf;
	while (m--) {
		int a, b; scanf("%d %d", &a, &b);
		dist[a][b] = dist[b][a] = 1;
	}
	for (int k = 1; k <= n; k++)
		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= n; j++)
			V[j].clear();
		for (int j = 1; j <= n; j++)
			V[dist[i][j]].push_back(j);
		ld my = 0.0;
		for (int j = 0; j <= n; j++) if (!V[j].empty()) {
			ld best = 1 / ld(n);

			fill(prob, prob + n + 1, 0);
			slen = 0;
			for (int z = 0; z < V[j].size(); z++) {
				int v = V[j][z];
				int neighs = 0;
				for (int c = 1; c <= n; c++)
					if (dist[v][c] == 1) neighs++;
				for (int c = 1; c <= n; c++)
					if (dist[v][c] == 1) {
						if (prob[c] < 1e-9) seq[slen++] = c;
						prob[c] += 1 / ld(neighs);
					}
			}
			for (int l = 1; l <= n; l++) {
				for (int z = 0; z < blen; z++)
					mx[bseq[z]] = 0;
				blen = 0;
				for (int z = 0; z < slen; z++) {
					int d = dist[l][seq[z]];
					if (mx[d] < 1e-9) bseq[blen++] = d;
					mx[d] = max(mx[d], prob[seq[z]]);
				}
				ld cand = 0.0;
				for (int z = 0; z < blen; z++)
					cand += mx[bseq[z]];
				best = max(best, cand / n);
			}
			my += best;
		}
		res = max(res, my);
	}
	printf("%.15lf\n", double(res));
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
const int maxn = 401;

vector<int> G[maxn];
int dst[maxn][maxn];

double guess(int g, int d, int n){
	int t = 0;
	vector<double> probs(n + 1, 0);
	vector<bool> mk(n + 1, false);
	vector<int> vis;

	for (int u = 1; u <= n; ++u){
		if (dst[u][g] == d){
			t++;
			for (int v : G[u]){
				if (!mk[v]){
					mk[v] = true;
					vis.push_back(v);
				}
				probs[v] += 1.0 / G[u].size();
			}
		}
	}
	for (int u = 1; u <= n; ++u){
		probs[u] /= t;
	}

	double ans = 0;

	vector<double> mxpdst(n + 1);

	for (int g2 = 1; g2 <= n; ++g2){
		double prob = 0;

		for (int u : vis){
			mxpdst[dst[u][g2]] = max(mxpdst[dst[u][g2]], probs[u]);
		}

		for (int u : vis){
			if (mxpdst[dst[u][g2]] > 0){
				prob += mxpdst[dst[u][g2]];
				mxpdst[dst[u][g2]] = 0;
			}
		}

		ans = max(ans, prob);
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n, m;
	cin >> n >> m;

	memset(dst, 0x3f, sizeof dst);

	for (int i = 1; i <= n; ++i)
		dst[i][i] = 0;

	for (int i = 0; i < m; ++i){
		int u, v;
		cin >> u >> v;
		G[u].push_back(v);
		G[v].push_back(u);
		dst[u][v] = 1;
		dst[v][u] = 1;
	}

	for (int k = 1; k <= n; ++k)
		for (int i = 1; i <= n; ++i)
			for (int j = 1; j <= n; ++j)
				dst[i][j] = min(dst[i][j], dst[i][k] + dst[k][j]);

	double ans = 0;

	for (int g1 = 1; g1 <= n; ++g1){
		double prob = 0;
		for (int d1 = 0; d1 < n; ++d1){
			int t = 0;
			for (int u = 1; u <= n; ++u)
				if (dst[u][g1] == d1)
					t++;
			if (t == 0)
			break;
			prob += 1.0 * t / n * max(1.0 / t, guess(g1, d1, n));
		}
		ans = max(ans, prob);
	}

	cout.precision(17);
	cout << fixed << ans << endl;

	return 0;
}

//In the Name of God
//Ya Ali

#include<bits/stdc++.h>

#define ld long double

#define pb push_back

#define id second
#define val first

#define err(A) cout<<#A<<" = "<<(A)<<endl

using namespace std;

const int maxn=404;

int n,m;

vector<int> g[maxn];

vector<int> q,G;

int dis[maxn][maxn];

ld p[maxn],P;
pair<ld,int> mxp[maxn];

ld ans;

void bfs(int s)
{
  dis[s][s]=0;
  q.resize(0);
  q.pb(s);
  for(int v,i=0;i<q.size();i++)
    {
      v=q[i];
      for(int u:g[v])
	if(dis[s][v]+1<dis[s][u])
	  {
	    dis[s][u]=dis[s][v]+1;
	    q.pb(u);
	  }
    }
}

ld f(int v)
{
  //cout<<"f("<<v+1<<")"<<endl;

  ld ret=0;
  for(int d=0;d<n;d++)
    {
      //err(d);

      G.resize(0);
      for(int i=0;i<n;i++)
	p[i]=0;

      for(int i=0;i<n;i++)
	if(dis[v][i]==d)
	  {
	    //cout<<i+1<<" ";
	    for(int j:g[i])
	      {
		if(p[j]==0)
		  G.pb(j);
		p[j]+=P/g[i].size();
	      }
	  }
      //cout<<endl;
      //err(G.size());
      //for(int c:G)
	//cout<<c+1<<" ";
      //cout<<endl;

      if(!G.size())
	break;

      for(int i=0;i<n;i++)
	mxp[i]={0,-1};
      ld X=P,x;
      for(int u=0;u<n;u++)
        {
	  x=0;
	  for(int c:G)
	    {
	      if(mxp[dis[u][c]].id==u)
		x-=mxp[dis[u][c]].val;
	      if(mxp[dis[u][c]].id!=u or mxp[dis[u][c]].val<p[c])
		mxp[dis[u][c]]={p[c],u};
	      if(mxp[dis[u][c]].id==u)
		x+=mxp[dis[u][c]].val;
	    }
	  X=max(X,x);
	}
      //err(X);
      //cout<<endl;

      ret+=X;
    }
  return ret;
}

int main()
{
  memset(dis,127,sizeof dis);

  ios::sync_with_stdio(0);cin.tie(0);

  cin>>n>>m;
  for(int v,u,i=0;i<m;i++)
    {
      cin>>v>>u;
      v--,u--;
      g[v].pb(u);
      g[u].pb(v);
    }

  for(int i=0;i<n;i++)
    bfs(i);
  P=1.0/n;
  for(int i=0;i<n;i++)
    {
      //cout<<"f("<<i<<") = "<<f(i)<<endl;
      ans=max(ans,f(i));
    }

  cout<<setprecision(15)<<fixed<<ans<<endl;

  return 0;
}

#include<stdio.h>
#include<iostream>
using namespace std;
const int maxn=407;
const int INF=1E9+7;

int N,M,D[maxn][maxn],V[maxn],cv=0,W[maxn][maxn],cw[maxn];
bool vis[maxn];
double ans=0.0,P[maxn],VP[maxn];

int main(){
	scanf("%d%d",&N,&M);
	for(int i=1;i<=N;++i) for(int j=1;j<=N;++j) if(i!=j) D[i][j]=INF;
	for(int i=0;i<M;++i){
		int a,b;scanf("%d%d",&a,&b);
		W[a][cw[a]++]=b;
		W[b][cw[b]++]=a;
		D[a][b]=D[b][a]=1;
	}
	for(int k=1;k<=N;++k){
		for(int i=1;i<=N;++i) for(int j=1;j<=N;++j) if(D[i][k]+D[k][j]<D[i][j]){
			D[i][j]=D[i][k]+D[k][j];
		}
	}
	for(int i=1;i<=N;++i){
		double tans=0.0;
		for(int j=0;j<N;++j){
			double pp=0.0;
			int cntp=0;

			cv=0;
			for(int k=1;k<=N;++k) P[k]=0.0,vis[k]=false;
			for(int k=1;k<=N;++k) if(D[i][k]==j){
				++cntp;
				for(int l=0;l<cw[k];++l){
					int v=W[k][l];
					P[v]+=1.0/N/cw[k];
					if(!vis[v]){
						vis[v]=true;
						V[cv++]=v;
					}
				}
			}
			if(!cntp) break;

			pp=1.0/N;

			for(int k=1;k<=N;++k){
				double p2=0.0;
				for(int l=0;l<cv;++l){
					int v=V[l];
					VP[D[k][v]]=0;
				}
				for(int l=0;l<cv;++l){
					int v=V[l],d=D[k][v];
					if(P[v]>VP[d]){
						p2-=VP[d];
						p2+=P[v];
						VP[d]=P[v];
					}
				}

				pp=max(pp,p2);
			}

			tans+=pp;
		}
		ans=max(ans,tans);
	}
	printf("%.20lf\n",ans);
}

#include<stdio.h>
#include<iostream>
using namespace std;
const int maxn=477;
const int INF=1E9+7;

int N,M,D[maxn][maxn],V[maxn],cv=0,W[maxn][maxn],cw[maxn];
bool vis[maxn];
double ans=0.0,P[maxn],VP[maxn];

int main(){
	scanf("%d%d",&N,&M);
	for(int i=1;i<=N;++i) for(int j=1;j<=N;++j) if(i!=j) D[i][j]=INF;
	for(int i=0;i<M;++i){
		int a,b;scanf("%d%d",&a,&b);
		W[a][cw[a]++]=b;
		W[b][cw[b]++]=a;
		D[a][b]=D[b][a]=1;
	}
	for(int k=1;k<=N;++k){
		for(int i=1;i<=N;++i) for(int j=1;j<=N;++j) if(D[i][k]+D[k][j]<D[i][j]){
			D[i][j]=D[i][k]+D[k][j];
		}
	}
	for(int i=1;i<=N;++i){
		double tans=0.0;
		for(int j=0;j<N;++j){
			double pp=0.0;
			int cntp=0;

			cv=0;
			for(int k=1;k<=N;++k) P[k]=0.0,vis[k]=false;
			for(int k=1;k<=N;++k) if(D[i][k]==j){
				++cntp;
				for(int l=0;l<cw[k];++l){
					int v=W[k][l];
					P[v]+=1.0/N/cw[k];
					if(!vis[v]){
						vis[v]=true;
						V[cv++]=v;
					}
				}
			}
			if(!cntp) break;

			pp=1.0/N;

			for(int k=1;k<=N;++k){
				double p2=0.0;
				for(int l=0;l<cv;++l){
					int v=V[l];
					VP[D[k][v]]=0;
				}
				for(int l=0;l<cv;++l){
					int v=V[l],d=D[k][v];
					if(P[v]>VP[d]){
						p2-=VP[d];
						p2+=P[v];
						VP[d]=P[v];
					}
				}

				pp=max(pp,p2);
			}

			tans+=pp;
		}
		ans=max(ans,tans);
	}
	printf("%.20lf\n",ans);
}

//CONTEST SOURCE
#include <iostream>
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define VI vector<int>
#define all(s) (s).begin(),(s).end()
#define L(s) (int)(s).size()
#define inf 1000000000
#define pdd pair<double, double>
int n, m;
int a[444][444];

double u[444];
double u2[444];
int deg[444];
vector<int> vdist[444][444];

int main() {
  scanf("%d%d", &n, &m);
  for(int i = 0; i < n; ++i) {
    for(int j = 0; j < n; ++j) {
      a[i][j] = 1e8;
    }
    a[i][i] = 0;
  }

  for(int i = 0; i < m; ++i) {
    int x, y; scanf("%d%d", &x, &y); --x; --y;
    a[x][y] = a[y][x] = 1;
    ++deg[x]; ++deg[y];
  }

  for(int k = 0; k < n; ++k) {
    for(int i = 0; i < n; ++i) {
      for(int j = 0; j < n; ++j) {
        if (a[i][k] + a[k][j] < a[i][j]) {
          a[i][j] = a[i][k] + a[k][j];
        }
      }
    }
  }

  for(int i = 0; i < n; ++i) {
    for(int j = 0; j < n; ++j) {
      vdist[i][a[i][j]].pb(j);
    }
  }

  double win_2 = 0;
  for(int i = 0; i < n; ++i) {

    double cur_pro = 0;

    for(int dst = 0; dst < n; ++dst) {

      if (!L(vdist[i][dst])) continue;

      for(int j = 0; j < n; ++j) u[j] = 0;
      vector<int> inter(0);
      for(int j = 0; j < L(vdist[i][dst]); ++j) {
        int vj = vdist[i][dst][j];
        for(int k = 0; k < L(vdist[vj][1]); ++k) {
          if (u[vdist[vj][1][k]] < 1e-9) {
            inter.pb(vdist[vj][1][k]);
          }
          u[vdist[vj][1][k]] += 1. / deg[vj] / L(vdist[i][dst]);
        }
      }

      // sum of sizes of ed is N**2
      double best_other = 0;

      for(int j = 0; j < n; ++j) {
        for(int k = 0; k < L(inter); ++k) {
          u2[a[j][inter[k]]] = max(u2[a[j][inter[k]]], u[inter[k]]);
        }
        double cur_chance = 0;
        for(int k = 0; k < L(inter); ++k) {
          cur_chance += u2[a[j][inter[k]]];
          u2[a[j][inter[k]]] = 0;
        }
        best_other = max(best_other, cur_chance);
      }

      cur_pro += max(best_other, 1. / L(vdist[i][dst])) * 1. * L(vdist[i][dst]) / n;
    }
    win_2 = max(win_2, cur_pro);
  }

  printf("%0.15lf\n", win_2);
}

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sz(s) ((int) ((s).size()))
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

#ifdef _WIN32
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif

typedef long long ll;
typedef long double ld;

const int inf = (int) 1e9 + 100;
const ld eps = 1e-11;
const ld pi = acos(-1.0L);

mt19937 mrand(random_device{} ());
int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = 410;
int n, m;
vector<vector<int> > graph;

bool read() {
  if (scanf("%d%d", &n, &m) < 2) {
    return false;
  }
  graph = vector<vector<int> > (n);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    graph[a].pb(b);
    graph[b].pb(a);
  }
  return true;
}

vector<int> ondist[maxn][maxn];
int maxdist[maxn];

ld ans[maxn][maxn];
int cols[maxn][maxn];

ld vals[maxn];
int good[maxn], cntgood;

int tosum[maxn], cnttosum;
ld mx[maxn];
int used[maxn];

void solve() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ondist[i][j].clear();
    }
    queue<int> q;
    vector<int> dist(n, inf);
    q.push(i);
    dist[i] = 0;
    while (sz(q)) {
      int cur = q.front();
      q.pop();
      for (int k = 0; k < sz(graph[cur]); k++) {
        int to = graph[cur][k];
        if (dist[to] == inf) {
          dist[to] = dist[cur] + 1;
          q.push(to);
        }
      }
    }
    maxdist[i] = 0;
    for (int j = 0; j < n; j++) {
      ondist[i][dist[j]].pb(j);
      cols[i][j] = dist[j];
      maxdist[i] = max(maxdist[i], dist[j]);
    }
    for (int j = 0; j <= maxdist[i] ; j++) {
      ans[i][j] = (ld) 1 / n;
    }
  }
  memset(vals, 0, sizeof(vals));
  memset(used, 0, sizeof(used));
  for (int fs = 0; fs < n; fs++) {
    for (int dist1 = 0; dist1 <= maxdist[fs]; dist1++) {
      for (auto i : ondist[fs][dist1]) {
        for (auto j : graph[i]) {
          vals[j] += (ld) 1 / n / sz(graph[i]);
        }
      }
      /*for (int i = 0; i < n; i++) {
        eprintf("%.18f%c", (double) vals[i], " \n"[i == n - 1]);
      }*/
      cntgood = 0;
      for (int dist = max(0, dist1 - 1); dist <= min(dist1 + 1, maxdist[fs]); dist++) {
        for (auto i : ondist[fs][dist]) {
          good[cntgood++] = i;
        }
      }
      for (int sec = 0; sec < n; sec++) {
        //eprintf("sec = %d\n", sec);
        cnttosum = 0;
        for (int i = 0; i < cntgood; i++) {
          int cur = cols[sec][good[i]];
          if (!used[cur]) {
            used[cur] = true;
            tosum[cnttosum++] = cur;
            //eprintf("%d\n", cur);
          }
        }
        for (int i = 0; i < cnttosum; i++) {
          mx[tosum[i]] = 0;
        }
        for (int i = 0; i < cntgood; i++) {
          int cur = cols[sec][good[i]];
          mx[cur] = max(mx[cur], vals[good[i]]);
        }
        ld curans = 0;
        for (int i = 0; i < cnttosum; i++) {
          curans += mx[tosum[i]];
        }
        ans[fs][dist1] = max(ans[fs][dist1], curans);
        for (int i = 0; i < cntgood; i++) {
          int cur = cols[sec][good[i]];
          used[cur] = false;
        }
      }
      for (auto i : ondist[fs][dist1]) {
        for (auto j : graph[i]) {
          vals[j] = 0;
        }
      }
    }
  }
  ld res = 0;
  for (int i = 0; i < n; i++) {
    ld curres = 0;
    for (int j = 0; j <= maxdist[i]; j++) {
      //eprintf("%.18f%c", (double) ans[i][j], " \n"[j == maxdist[i]]);
      curres += ans[i][j];
    }
    res = max(res, curres);
  }
  printf("%.18f\n", (double) res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen("text.in", "r", stdin));
  assert(freopen("text.out", "w", stdout));
#endif

  while (true) {
    if (!read()) {
      break;
    }
    solve();
#ifdef DEBUG
    eprintf("Time: %.18f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}

#include <bits/stdc++.h>

using namespace std;
const int N = 410;
int n, m;
int g[N][N];
vector <int> p[N], G[N], pd;
int sz[N], vis[N];
double dx[N], dis[N];
double mx[N];
int tim[N];
double work(int s){
  for (int i = 0; i < n; ++ i) p[i].clear();
  for (int i = 1; i <= n; ++ i){
    p[g[s][i]].push_back(i);
  }
  //printf("%d %d\n", g[1][3], d[3]);
  double res = 0;
  for (int i = 0; i < n; ++ i){
    double y = p[i].size();
    if (y == 0) continue;
    pd.clear();
    memset(dx, 0, sizeof dx);
    memset(vis, 0, sizeof vis);
    for (int u: p[i]){
        //printf("%d\n", u);
        for (int k : G[u]){
          if (vis[k] == 0) pd.push_back(k);
          vis[k] = 1;
          dx[k] += 1.0 / n / sz[u];
        }
    }
    //memset(tim, 0, sizeof tim);
    if (pd.size() == 0) continue;
    double tres = 0;
    for (int j = 1; j <= n; ++ j){
      double tmp = 0;
      //memset(mx, 0, sizeof mx);
      for (int v : pd){
        int dd = g[j][v];
        if (tim[dd] != j){
          tim[dd] = j;
          mx[dd] = 0;
        }
        if (dx[v] > mx[dd]){
          tmp += dx[v] - mx[dd];
          //if (i == 1 && j == 1) printf("%d %f %d\n", dd, dx[v], v);
          mx[dd] = dx[v];
        }
      }
      tres = max(tres, tmp);
    }
    if (p[i].size() > 0) res += max(1.0/n, tres);
    //printf("%f %f %d\n", tres, res, n);
  }
  return res;
}
int main(){
  memset(g, -1, sizeof g);
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++ i){
    int u, v; scanf("%d %d", &u, &v);
    //printf("%d %d\n", u, v);
    G[u].push_back(v);
    G[v].push_back(u);
    sz[u]++; sz[v]++;
    g[u][v] = 1;
    g[v][u] = 1;
  }
  for (int k = 1; k <= n; ++ k){
    g[k][k] = 0;
    for (int i = 1; i <= n; ++ i){
      for (int j = 1; j <= n; ++ j){
        if (g[i][k] != -1 && g[k][j] != -1 && (g[i][j] > g[i][k] + g[k][j] || g[i][j] == -1)){
          g[i][j] = g[i][k] + g[k][j];
        }
      }
    }

  }
  double ans = 0;
  for (int i = 1; i <= n; ++ i){
    ans = max(ans, work(i));
    //break;
  }
  printf("%.10f\n", ans);
}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define maxn 405
#define maxm (maxn * maxn)
#define mem(a,b) memset(a,b,sizeof(a))
#define db double
#define pb(a) push_back(a)
using namespace std;

int f[maxn][maxn];

int head[maxn],t[maxm * 2],next[maxm * 2],sum;

int din[maxn];

int n,m;

db ans;

void insert(int x,int y){
	t[++sum]=y;
	next[sum]=head[x];
	head[x]=sum;
}

db p[maxn],dis[maxn];

vector<int> th;

bool bz[maxn];

db calc(int now){
	db ret=0;
	fo(i,0,n) {
		mem(p,0);
		th.clear();
		db today=1.0/n,nd=0;//(1 / size * (size / n)
		fo(j,1,n) {
			if (f[now][j]!=i) continue;
			for(int tmp=head[j];tmp;tmp=next[tmp]) {
				if (p[t[tmp]]==0) th.pb(t[tmp]);
				p[t[tmp]]+=1.0 / n / din[j];
			}
		}
		if (th.size()==0) continue;
		fo(tomo,1,n) {
			mem(dis,0);
			mem(bz,0);
			fo(j,0,th.size()-1) {
				int x=th[j];
				dis[f[tomo][x]]=max(dis[f[tomo][x]],p[x]);
			}
			db tmp=0;
			fo(j,0,th.size()-1) {
				int x=th[j];
				if (bz[f[tomo][x]]) continue;
				tmp=tmp+dis[f[tomo][x]];
				bz[f[tomo][x]]=1;
			}
			nd=max(nd,tmp);
		}
		ret+=max(today,nd);
	}
	return ret;
}

int main(){
	mem(f,63);
	scanf("%d%d",&n,&m);
	fo(i,1,n) f[i][i]=0;
	fo(i,1,m) {
		int x,y;
		scanf("%d%d",&x,&y);
		din[x]++;
		din[y]++;
		insert(x,y);
		insert(y,x);
		f[x][y]=f[y][x]=1;
	}
	fo(k,1,n)
		fo(i,1,n)
			fo(j,1,n) f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	fo(i,1,n) {
		db now=calc(i);
		ans=max(ans,now);
	}
	printf("%.8lf",ans);
	return 0;
}

#include <bits/stdc++.h>

// macros
#define forn(i, a, n) for (int i = a; i < n; ++i)
#define forr(i, a, n) for (int i = (n) - 1; i >= a; --i)
#define pb push_back
#define pf push_front
#define lag long long
#define vi vector<int>
#define pii pair<int, int>
#define inf 0xdeadbee

using namespace std;
const int N = 405;
typedef bitset<N> bits;

int n, m;
int dist[N][N];
vi reach[N][N], adj[N], nx;
double prob[N], dprob[N];

double f(int city) {
	// complexity should be O(n^2)
	double pE = 0;
	forn (dist1, 0, n + 1) {
		// for each distance, collect all reachables
		double today = 1.0 / n; // (1 / reachables.size()) * (reachables.size() / n)
		// mark node probability
		// note: O(n) because all nodes and distance is one to one
		auto& reachables = reach[city][dist1];
		if (reachables.empty()) continue;
		int total = 0;
		for (int r : reachables)
			for (int v : adj[r]) {
				if (prob[v] == 0.0)
					nx.pb(v);
				// probability that lamak will end up in v tomorrow
				prob[v] += 1.0 / n / adj[r].size();
			}
		double tomorrow = 0;
		// try each second city
		forn (city2, 1, n + 1) {
			// choose best lamak for each distance
			for (int v : nx) {
				int d = dist[city2][v];
				dprob[d] = max(dprob[d], prob[v]);
			}
			// get the probability for each distance
			double E = 0;
			for (int v : nx) {
				int d = dist[city2][v];
				E += dprob[d];
				dprob[d] = 0; // reset
			}
			tomorrow = max(tomorrow, E);
		}
		// reset
		for (int v : nx)
			prob[v] = 0;
		nx.clear();
		// cout << today << ' ' << tomorrow << endl;
		pE += max(today, tomorrow);
	}
	return pE;
}

int main() {
	scanf("%d%d", &n, &m);
	forn (i, 1, n + 1) {
		forn (j, 1, n + 1)
			dist[i][j] = inf;
		dist[i][i] = 0;
	}
	forn (i, 0, m) {
		int u, v; scanf("%d%d", &u, &v);
		dist[u][v] = dist[v][u] = 1;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	forn (k, 1, n + 1)
	forn (i, 1, n + 1)
	forn (j, 1, n + 1)
		dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
	forn (i, 1, n + 1)
	forn (j, 1, n + 1)
		if (dist[i][j] != inf)
			reach[i][dist[i][j]].pb(j);
	double mx = 0;
	int mxi;
	forn (i, 1, n + 1) {
		if (mx < f(i)) {
			mx = f(i);
			mxi = i;
		}
	}
	printf("%.20lf\n", mx);

}

#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int maxn = 405;
int d[maxn][maxn],n,m;
double dis[maxn];
double posi[maxn];
vector<int> E[maxn];
vector<int> f;
void TAT()
{
    memset(d,127,sizeof(127));
}
double next(int p,int di)
{
    double ans = 0;
    memset(posi,0,sizeof(posi));

    for(int i=1;i<=n;i++)
        if(d[p][i]==di)
            for(auto v:E[i])
                posi[v]+=1./n/E[i].size();

    f.clear();

    for(int i=1;i<=n;i++)
        if(posi[i]>eps)
            f.push_back(i);

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(auto v:f)
            dis[d[i][v]]=max(dis[d[i][v]],posi[v]);
        for(auto v:f)
        {
            tmp+=dis[d[i][v]];
            dis[d[i][v]]=0;
        }
        ans=max(ans,tmp);
    }
    return ans;
}
void QAQ()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if(i!=j)d[i][j]=n+1;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        d[a][b]=1;
        d[b][a]=1;
        E[a].push_back(b);
        E[b].push_back(a);
    }

    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);

    double ans = 0;

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(int di=0;di<n;di++)
        {
            int cnt = 0;
            for(int j=1;j<=n;j++)if(d[i][j]==di)cnt++;
            if(cnt==0)continue;
            double day1 = 1./n;
            double day2 = next(i,di);
            tmp+=max(day1,day2);
        }
        ans=max(ans,tmp);
    }
    printf("%.12f\n",ans);
}
int main()
{
    TAT();
    QAQ();
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define For(i,n) for(int i=1;i<=n;i++)
#define Fork(i,k,n) for(int i=k;i<=n;i++)
#define Rep(i,n) for(int i=0;i<n;i++)
#define ForD(i,n) for(int i=n;i;i--)
#define ForkD(i,k,n) for(int i=n;i>=k;i--)
#define RepD(i,n) for(int i=n;i>=0;i--)
#define Forp(x) for(int p=Pre[x];p;p=Next[p])
#define Forpiter(x) for(int &p=iter[x];p;p=Next[p])
#define Lson (o<<1)
#define Rson ((o<<1)+1)
#define MEM(a) memset(a,0,sizeof(a));
#define MEMI(a) memset(a,127,sizeof(a));
#define MEMi(a) memset(a,128,sizeof(a));
#define INF (2139062143)
#define F (100000007)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define SI(a) ((a).size())
typedef long long ll;
typedef unsigned long long ull;
ll mul(ll a,ll b){return (a*b)%F;}
ll add(ll a,ll b){return (a+b)%F;}
ll sub(ll a,ll b){return (a-b+llabs(a-b)/F*F+F)%F;}
void upd(ll &a,ll b){a=(a%F+b%F)%F;}
int read()
{
	int x=0,f=1; char ch=getchar();
	while(!isdigit(ch)) {if (ch=='-') f=-1; ch=getchar();}
	while(isdigit(ch)) { x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}
#define MAXN (410)
vi edges[MAXN];
int n,m,f[MAXN][MAXN];
double pro[MAXN],pro_dis[MAXN];
bool b[MAXN];
double calc(int g1,int d1,int cnt) {
	MEM(pro) MEM(b) MEM(pro_dis)
	vi visit_point;
	For(i,n) if (f[g1][i]==d1) {
		int sz=SI(edges[i]);
		Rep(j,sz) {
			int v=edges[i][j];
			pro[v]+=1./cnt/sz;
			if (!b[v]) b[v]=1,visit_point.pb(v);
		}
	}
	// which city use BGDS tomorrow
	double ans=0;
	For(i,n) {
		int sz=SI(visit_point);
		Rep(j,sz) {
			int v=visit_point[j];
			pro_dis[f[i][v]] =max(pro_dis[f[i][v]],pro[v]);
		}
		double an=0;
		Rep(j,sz) {
			int v=visit_point[j];
			an+=pro_dis[f[i][v]];
			pro_dis[f[i][v]]=0;
		}
		ans=max(ans,an);
	}
	return ans;

}
int main()
{
//	freopen("D.in","r",stdin);
//	freopen(".out","w",stdout);
	cin>>n>>m;
	MEMI(f)
	For(i,n) f[i][i]=0;
	For(i,m) {
		int a=read(),b=read();
		f[a][b]=f[b][a]=min(f[a][b],1);
		edges[a].pb(b);
		edges[b].pb(a);
	}
	For(k,n) For(i,n) For(j,n) if (f[i][k]!=INF&&f[k][j]!=INF)
		f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	double ans=0;
	For(i,n) {
		double nowans=0;
		Rep(d,n+1) {
			int cnt=0;
			For(j,n) if (f[i][j]==d) ++cnt;
			if (!cnt) continue;
			double p=(double)cnt/n;
			// wait tomorrow
			double t=calc(i,d,cnt);
			nowans+=p*max(t,1./cnt);
		}
		ans=max(ans,nowans);
	}
	printf("%.12lf\n",ans);
	return 0;
}

#include<bits/stdc++.h>

#define x first
#define y second
#define pb push_back

using namespace std;

typedef long long INT;
typedef vector<int> VI;
typedef pair<int, int> pii;

template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}
template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}
int power(int a, int b, int m, int ans=1){for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m; return ans;}

typedef double DO;
#define NN 410
int n, d[NN][NN];
VI vec[NN][NN];
DO p[NN], mmx[NN];

DO calc(int f){
	DO ans=0;
	for(int l=0; l<n; l++) if(!vec[f][l].empty()){
		if(vec[f][l].size()==1){
			ans+=1.0/n;
			continue;
		}
		for(int i=1; i<=n; i++) p[i]=0;
		VI nxt;
		for(int v : vec[f][l]){
			DO x=1.0/n/vec[v][1].size();
			for(int w : vec[v][1]){
				if(p[w]<1e-9) nxt.pb(w);
				p[w]+=x;
			}
		}
		DO mx=1.0/n;
		for(int i=1; i<=n; i++){
			DO s=0;
			for(int w : nxt) smax(mmx[d[i][w]], p[w]);
			for(int w : nxt) s+=mmx[d[i][w]], mmx[d[i][w]]=0;
			smax(mx, s);
		}
		ans+=mx;
	}
	return ans;
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int m;
	cin >> n >> m;
	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) d[i][j]=(i!=j)*n;

	for(int i=0, u, v; i<m; i++){
		gn(u, v);
		d[u][v]=d[v][u]=1;
	}
	for(int k=1; k<=n; k++) for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) smin(d[i][j], d[i][k]+d[k][j]);
	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) vec[i][d[i][j]].pb(j);

	DO ans=0;
	for(int i=1; i<=n; i++) smax(ans, calc(i));

	printf("%.12lf\n", ans);

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
typedef double T;
const int nax = 1005;
int dist[nax][nax];
vector<int> w[nax];
T p_later[nax]; // p[v] - probability for city v in the second day
T p_dist_max[nax];
bool vis[nax];
void max_self(T & a, T b) {
	a = max(a, b);
}
T consider_tomorrow(int n, int g1, int dist1) {
	T best_tomorrow = 0;
	// we need complexity O(n * x)
	// where x denotes the number of v that |dist1-dist[g1][v]| <= 1
	for(int i = 1; i <= n; ++i) p_later[i] = 0,vis[i] = false;
	vector<int> interesting;
	for(int v = 1; v <= n; ++v) if(dist[g1][v] == dist1)
		for(int b : w[v]) {
			// Limak started in v with prob. 1/n
			// he then moved to b with prob. 1/degree[v]
			p_later[b] += (T) 1 / n / w[v].size();
			if(!vis[b]) {
				vis[b] = true;
				interesting.push_back(b);
			}
		}
	// interesting.size() <= x, where x is defined above (needed for complexity)
	for(int g2 = 1; g2 <= n; ++g2) {
		T local_sum = 0; // over situations with fixed g1, dist1, g2
		for(int b : interesting) max_self(p_dist_max[dist[g2][b]], p_later[b]);
		for(int b : interesting) {
			local_sum += p_dist_max[dist[g2][b]];
			p_dist_max[dist[g2][b]] = 0; // so it won't be calculated twice
		}
		max_self(best_tomorrow, local_sum);
	}
	return best_tomorrow;
}
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	FOR(i,1,n) FOR(j, 1, n) if(i != j) dist[i][j] = n + 1; // infinity
	FOR(i,1,m) {
		int a, b;
		scanf("%d%d", &a, &b);
		w[a].push_back(b);
		w[b].push_back(a);
		dist[a][b] = dist[b][a] = 1;
	}
	// Floyd-Warshall
	FOR(b,1,n)FOR(a,1,n)FOR(c,1,n) dist[a][c] = min(dist[a][c], dist[a][b] + dist[b][c]);
	// g1 is the first guess
	T answer = 0;
	FOR(g1, 1, n) {
		T sum_over_dist1 = 0;
		FOR(dist1, 0, n) {//self
			int cnt_cities = 0;
			FOR(i, 1, n) if(dist[g1][i] == dist1) ++cnt_cities;
			if(cnt_cities == 0) continue; // there are no cities within distance dist1
			// 1) consider guessing immediately
            // printf("g1:%d d:%d here\n",g1,dist1);
			T immediately = (T) 1 / n; // how much it counts towards the answer
			// 2) consider waiting for tomorrow
			T second_day = consider_tomorrow(n, g1, dist1);
			sum_over_dist1 += max(immediately, second_day);
		}
		max_self(answer, sum_over_dist1);
	}
	printf("%.12lf\n", (double) answer);
	return 0;
}

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 405
int n,m,now;
int map[N][N],pa[N*N],pb[N*N],in1[N],b[N],vis[N][N];
double s0[N][N],s1[N][N],s2[N][N],p[N][N],a[N],tmp,ans;
vector<int>v[N];
vector<int>::iterator it;
void update(int a,int b,double x)
{
	if(a<0)return;
	if(vis[a][b]!=now)vis[a][b]=now,p[a][b]=0,v[a].push_back(b);
	p[a][b]=max(p[a][b],x);
}
int main()
{
	// freopen("leidilu.in","r",stdin);
	// freopen("leidilu.out","w",stdout);
	scanf("%d%d",&n,&m);memset(map,0x3f,sizeof(map));for(int i=1;i<=n;i++)map[i][i]=0;
	for(int i=1,x,y;i<=m;i++)scanf("%d%d",&x,&y),pa[i]=x,pb[i]=y,in1[x]++,in1[y]++,map[x][y]=map[y][x]=1;
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				map[i][j]=min(map[i][j],map[i][k]+map[k][j]);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		{
			int x=pa[j],y=pb[j];
			if(map[i][y]==map[i][x]+1)
				s1[i][x]+=1.0/n/in1[y],s2[i][y]+=1.0/n/in1[x];
			else if(map[i][y]==map[i][x]-1)
				s1[i][y]+=1.0/n/in1[x],s2[i][x]+=1.0/n/in1[y];
			else
				s0[i][y]+=1.0/n/in1[x],s0[i][x]+=1.0/n/in1[y];
		}
	for(int i=1;i<=n;i++)
	{
		memset(b,0,sizeof(b));memset(a,0,sizeof(a));
		for(int j=1;j<=n;j++)b[map[i][j]]++;
		for(int j=0;j<n;j++)if(b[j])a[j]=1.0/n;
		for(int j=1;j<=n;j++)
		{
			now++;
			for(int k=1;k<=n;k++)
			{
				update(map[i][k],map[j][k],s0[i][k]);
				update(map[i][k]+1,map[j][k],s1[i][k]);
				update(map[i][k]-1,map[j][k],s2[i][k]);
			}
			for(int k=0;k<=n;k++)
			{
				tmp=0;
				for(it=v[k].begin();it!=v[k].end();it++)tmp+=p[k][*it];
				v[k].clear();a[k]=max(tmp,a[k]);
			}
		}tmp=0;
		for(int j=0;j<=n;j++)tmp+=a[j];ans=max(ans,tmp);
	}printf("%.12lf\n",ans);
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cassert>
using namespace std;

const int MaxN = 405, inf = 0x3f3f3f3f;

struct Graph {
  int n;
  vector<vector<int>> edges, dist;

  inline Graph(int _n) : n(_n) {
    edges.assign(n + 1, vector<int>());
    dist.assign(n + 1, vector<int>(n + 1, inf));
    for (int i = 0; i <= n; ++i)
      dist[i][i] = 0;
  }
  inline void AddEdge(int x, int y) {
    edges[x].emplace_back(y);
    edges[y].emplace_back(x);
    dist[x][y] = dist[y][x] = 1;
  }
  inline void Floyd() {
    for (int k = 1; k <= n; ++k)
      for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
          dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
  }
  inline double Compute(int start, int dis) {
    vector<int> nodes;
    vector<double> prob(n + 1, 0), max_prob(n + 1, 0);
    vector<bool> vis(n + 1, false);
    for (int i = 1; i <= n; ++i) {
      if (dist[start][i] == dis) {
        for (int nxt : edges[i]) {
          if (!vis[nxt]) {
            nodes.emplace_back(nxt);
            vis[nxt] = true;
          }
          prob[nxt] += 1.0 / n / edges[i].size();
        }
      }
    }
    double max_sum = 0;
    for (int j = 1; j <= n; ++j) {
      double res = 0;
      for (int nxt : nodes) {
        int d = dist[j][nxt];
        max_prob[d] = max(prob[nxt], max_prob[d]);
      }
      for (int nxt : nodes) {
        int d = dist[j][nxt];
        res += max_prob[d];
        max_prob[d] = 0;
      }
      max_sum = max(max_sum, res);
    }
    return max_sum;
  }
  inline double Solve() {
    double answer = 0;
    for (int i = 1; i <= n; ++i) {
      double cur = 0;
      for (int d1 = 0; d1 <= n; ++d1) {
        int cnt = 0;
        for (int j = 1; j <= n; ++j)
          if (dist[i][j] == d1)
            ++cnt;
        if (cnt == 0)
          continue;
        double prob = 1 / (1.0 * n);
        cur += max(prob, Compute(i, d1));
      }
      answer = max(answer, cur);
    }
    return answer;
  }
};

int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  Graph G(n);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    G.AddEdge(x, y);
  }
  G.Floyd();
  cout << setprecision(10) << fixed << G.Solve() << endl;
  return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cassert>
using namespace std;
vector<vector<int>> adj;
int dist[401][401];
constexpr int inf = 12345;
int n;
void FloydWarshal() {
	for (int k=0;k<n;++k) {
		for (int i=0;i<n;++i) {
			for (int j=0;j<n;++j){
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}
}
vector<int> ring[401][401];
void PrepareRing() {
  for (int i=0;i<n;++i){
  	for(int j=0;j<n;++j){
  		ring[i][dist[i][j]].push_back(j);
  	}
  }
}
vector<int> neighbour_adj[401][401];
vector<double> neighbour_prob[401][401];
void PrepareNeighbour() {
	double temp[410];
	int bitmask[20];
  for (int i=0;i<n;++i){
  	for (int d=0;d<n;++d){
  		for (int k=0;k<n;++k)temp[k]=0;
  		for (int k=0;k<22;++k)bitmask[k]=0;
  		for (int j : ring[i][d]) {
  			for (int k : adj[j]) {
  				temp[k] += 1.0/ring[i][d].size() * 1.0/adj[j].size();
  				bitmask[k/20] |= (1 << (k - (k/20)*20));
  			}
  		}
  		for(int b=0;b<n;++b){
  			if (bitmask[b/20] & (1 << (b - (b/20)*20))) {
  			  neighbour_adj[i][d].push_back(b);
  			  neighbour_prob[i][d].push_back(temp[b]);
  			}
  		}
  	}
  }
}
double SecondProb(int s, int i, int t) {
	double prob_second = 0;
	//for (int s=0;s<n;++s){
		//for(int i=0;i<n;++i){
			//if (adj[i].empty()) continue;
			//for(int t=0;t<n;++t){
			  int d = dist[s][i];
				for (int j : adj[i]) {
			    int g = 0, h = 0;
			    int dtj = dist[t][j];
			    double norm = 0;
			    double max_prob_t = 0;
			    int cnt = 0;
			    bool is_j_included = false;
			    while (g < ring[t][dtj].size() &&
			           h < neighbour_adj[s][d].size()) {
			    	if (ring[t][dtj][g] ==  neighbour_adj[s][d][h]) {
			    		double prob = neighbour_prob[s][d][h];
			    		if (max_prob_t < prob) {
			    			if (is_j_included) {
			    				is_j_included = false;
			    				break;
			    			} else {
			    				is_j_included = j == neighbour_adj[s][d][h];
			    			}
			    			max_prob_t = prob;
			    			cnt = 1;
			    		} else if (max_prob_t == prob) {
			    			cnt++;
			    		}
			    		++g; ++h;
			    		continue;
			    	}
			    	if (ring[t][dtj][g] < neighbour_adj[s][d][h]) {
			    		++g;
			    	} else {
			    		++h;
			    	}
			    }
			    prob_second += (is_j_included ? 1.0/cnt : 0.0);
				}
				prob_second /= adj[i].size();
				return prob_second;
			//}
		//}
	//}
}
double Solve() {
	double max_prob_s;
	for (int s=0;s<n;++s){
		double prob_s = 0;
		for(int d=0;d<n;++d){
			double max_prob_t = 0;
			if (ring[s][d].empty()) continue;
			for(int t=0;t<n;++t){
				double prob_t = 0;
				for (int i : ring[s][d]) {
					prob_t += 1.0/n * max(1.0/ring[s][d].size(), SecondProb(s, i, t));
				}
				max_prob_t = max(prob_t, max_prob_t);
			}
			prob_s += max_prob_t;
		}
		max_prob_s = max(prob_s, max_prob_s);
	}
	return max_prob_s;
}
int main(){
	int m;
	scanf("%d%d",&n,&m);
	int u,v;
	for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
			dist[i][j]=inf;
		}
		dist[i][i]=0;
	}
	adj.resize(n);
	for(int i=0;i<m;++i){
		scanf("%d%d",&u,&v);
		u--;v--;
		adj[u].push_back(v);
		adj[v].push_back(u);
		dist[u][v] = dist[v][u] = 1;
	}
	FloydWarshal();
	PrepareRing();
	PrepareNeighbour();
	printf("%.12f\n",Solve());
	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll int
#define N 405
#define M 80005
#define eps (1e-6)
#define rep(i,j,k) for (ll i=j;i<=k;++i)
#define per(i,j,k) for (ll i=j;i>=k;--i)
using namespace std;
inline ll read(){
	char ch=getchar(); ll x=0,f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
ll n,m,tot,a[N],f[N][N],head[N],size[N];
double p[N],dis[N],ans=0;
struct edge{ ll to,next; }e[M];
void add(ll u,ll v){
	e[++tot]=(edge){v,head[u]}; head[u]=tot; ++size[u];
}
double calc(ll x,ll d1){
	rep(i,1,n) p[i]=0;
	double ans=0; ll cnt=0;
	rep(i,1,n) if (f[x][i]==d1){
		for (ll j=head[i],v=e[j].to;j;j=e[j].next,v=e[j].to)
			p[v]+=1.0/n/size[i];
	}
	rep(i,1,n) if (p[i]>eps) a[++cnt]=i;
	rep(i,1,n){
		double tmp=0;
		rep(j,1,cnt) dis[f[i][a[j]]]=max(dis[f[i][a[j]]],p[a[j]]);
		rep(j,1,cnt) tmp+=dis[f[i][a[j]]],dis[f[i][a[j]]]=0;
		ans=max(ans,tmp);
	}
	return ans;
}
int main(){
	n=read(); m=read();
	rep(i,1,n) rep(j,1,n) if (i!=j) f[i][j]=n+1;
	rep(i,1,m){
		ll u=read(),v=read();
		add(u,v); add(v,u);
		f[u][v]=f[v][u]=1;
	}
	rep(k,1,n) rep(i,1,n) rep(j,1,n)
		f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	rep(i,1,n){
		double tmp=0;
		rep(d1,0,n-1){
			ll cnt=0;
			rep(j,1,n) if (f[i][j]==d1) ++cnt;
			if (!cnt) continue;
			double day1=1.0/n;
			double day2=calc(i,d1);
			tmp+=max(day1,day2);
		}
		ans=max(ans,tmp);
	}
	printf("%.12f",ans);
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <math.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int inf = 0x3f3f3f3f;

const int maxn=444;
int n,m;
vector<int> g[maxn];
vector<int> dg[maxn];
int dis[maxn][maxn];

void add_edge(int u,int v){
	g[u].push_back(v);
	g[v].push_back(u);
}

void floyd(){
	for (int u = 1; u <= n; ++u)
	{
		dis[u][u]=0;
	}

	for (int k = 1; k <= n; ++k)
	{
		for (int i = 1; i <= n; ++i)
		{
			for (int j = 1; j <= n; ++j)
			{
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

double mx[maxn];
double probability[maxn];
bool used[maxn];
vector<int> p;
double solve(vector<int> dg){
	memset(probability,0,sizeof probability);
	memset(used,false,sizeof used);
	p.clear();

	for (int i = 0; i < dg.size(); ++i)
	{
		int u=dg[i];
		for (int j = 0; j < g[u].size(); ++j)
		{
			int v=g[u][j];
			probability[v]+=1.0/n/g[u].size();
			if(used[v]==false){
				used[v]=true;
				p.push_back(v);
			}
		}
	}

	double ans=0;

	for (int i = 0; i < p.size(); ++i)
	//for(int u=1; u<=n; u++)
	{
		memset(mx,0,sizeof mx);
		int u=p[i];
		double aux=0;
		for (int j = 0; j < p.size(); ++j)
		{
			int v=p[j];
			if(mx[dis[u][v]]<probability[v]){
				aux+=probability[v]-mx[dis[u][v]];
				mx[dis[u][v]]=probability[v];
			}
		}
		ans=max(ans,aux);
	}
	return ans;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
#endif

    scanf("%d%d",&n,&m);
    memset(dis,0x3f,sizeof dis);
    for (int i = 0; i < m; ++i)
    {
    	int u,v;
    	scanf("%d%d",&u,&v);
    	add_edge(u,v);
    	dis[u][v]=dis[v][u]=1;
    }

    floyd();
    double ans=0;
    for (int i = 1; i <= n; ++i)
    {
    	double aux=1.0/n;
    	for (int j = 0; j <= n; ++j)
    	{
    		dg[j].clear();
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		dg[dis[i][j]].push_back(j);
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		if(dg[j].size()==1) aux+=1.0/n;
    		else	aux+=solve(dg[j]);
    	}
    	ans=max(ans,aux);
    }
    printf("%.10f\n",ans);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int dis[505][505],q[505];
double b[505],c[505];
int n,m,x,y;
double ans;
int main(){
	scanf("%d%d",&n,&m);
	memset(dis,1,sizeof(dis));
	for (int i=1;i<=n;i++) dis[i][i]=0;
	for (int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		dis[x][y]=dis[y][x]=1;
	}
	for (int k=1;k<=n;k++)
		for (int i=1;i<=n;i++)
			for (int j=1;j<=n;j++)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for (int i=1;i<=n;i++){
		double r=0;
		for (int j=0;j<n;j++){
			int u=0,p=0; double t=0;
			memset(b,0,sizeof(b));
			for (int k=1;k<=n;k++)
				if (dis[i][k]==j){
					int v=0; u++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) v++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) b[l]+=1.0/v;
				}
			for (int k=1;k<=n;k++)
				if (abs(dis[i][k]-j)<=1)
					q[++p]=k;
			for (int k=1;k<=n;k++){
				double w=0;
				for (int l=1;l<=p;l++)
					if (b[q[l]]>c[dis[k][q[l]]])
						c[dis[k][q[l]]]=b[q[l]];
				for (int l=1;l<=p;l++)
					w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				t=max(t,w);
			}
			if (u==1) t=max(t,1.0);
			r+=t/n;

		}
		ans=max(ans,r);
	}
	printf("%.12lf\n",ans);
}

#include <bits/stdc++.h>
using namespace std;

const int MAX = 500;

vector<int> edge[MAX];
int G[MAX][MAX];
int cnt_nxt[MAX];
double p_nxt[MAX], p_dist[MAX];
bool vis[MAX];

int n, m;

double solve(int g1, int dist1) {
    double rst = 0;
    for (int i = 1; i <= n; i++) {
        p_nxt[i] = 0;
        vis[i] = false;
    }
    vector<int> city;
    for (int v = 1; v <= n; v++) {
        if (G[g1][v] != dist1) continue;
        for (auto b : edge[v]) {
            p_nxt[b] += 1.0 / n / edge[v].size();
            if (!vis[b]) vis[b] = true, city.push_back(b);
        }
    }
    for (int g2 = 1; g2 <= n; g2++) {
        double tmp = 0;
        for (auto b : city) {
            p_dist[G[g2][b]] = max(p_dist[G[g2][b]], p_nxt[b]);
            p_nxt[b] = 0;
            vis[b] = false;
        }
        for (auto b : city) {
            tmp += p_dist[G[g2][b]];
            p_dist[G[g2][b]] = 0;
        }
        rst = max(rst, tmp);
    }
    return rst;
}

int main() {
    scanf("%d %d", &n, &m);

    memset(G, 0x3f, sizeof(G));
    for (int i = 1; i <= n; i++) G[i][i] = 0;

    for (int i = 1; i <= m; i++) {
        int u, v;
        scanf("%d %d", &u, &v);
        edge[u].push_back(v);
        edge[v].push_back(u);
        G[u][v] = G[v][u] = 1;
    }

    for (int b = 1; b <= n; b++) {
        for (int a = 1; a <= n; a++) {
            for (int c = 1; c <= n; c++) {
                G[a][c] = min(G[a][c], G[a][b] + G[b][c]);
            }
        }
    }

    double ans = 0;
    for (int g1 = 1; g1 <= n; g1++) {
        double tans = 0;
        for (int dist1 = 0; dist1 <= n; dist1++) {
            int cnt_city = 0;
            for (int i = 1; i <= n; i++) if (G[g1][i] == dist1) cnt_city++;
            if (!cnt_city) continue;
            tans += max(1.0 / n, solve(g1, dist1));
        }
        ans = max(tans, ans);
    }

    printf("%.12f\n", ans);
}

#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int maxn = 405;
int d[maxn][maxn],n,m;
double dis[maxn];
double posi[maxn];
vector<int> E[maxn];
vector<int> f;
void TAT()
{
    memset(d,127,sizeof(127));
}
double next(int p,int di)
{
    double ans = 0;
    memset(posi,0,sizeof(posi));
	for (int i=0;i<=n;++i) dis[i]=0;

    for(int i=1;i<=n;i++)
        if(d[p][i]==di)
            for(auto v:E[i])
                posi[v]+=1./n/E[i].size();

    f.clear();

    for(int i=1;i<=n;i++)
        if(posi[i]>eps)
            f.push_back(i);

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(auto v:f)
            dis[d[i][v]]=max(dis[d[i][v]],posi[v]);
        for(auto v:f)
        {
            tmp+=dis[d[i][v]];
            dis[d[i][v]]=0;
        }
        ans=max(ans,tmp);
    }
    return ans;
}
void QAQ()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if(i!=j)d[i][j]=n+1;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        d[a][b]=1;
        d[b][a]=1;
        E[a].push_back(b);
        E[b].push_back(a);
    }

    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);

    double ans = 0;

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(int di=0;di<n;di++)
        {
            int cnt = 0;
            for(int j=1;j<=n;j++)if(d[i][j]==di)cnt++;
            if(cnt==0)continue;
            double day1 = 1./cnt;
            double day2 = next(i,di);
            tmp+=max(day1,day2);
        }
        ans=max(ans,tmp);
    }
    printf("%.12f\n",ans);
}
int main()
{
    TAT();
    QAQ();
    return 0;
}

// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
const int N = 405, mod = 0;

int d[N][N], mat[N][N], deg[N];
double cnt[N][N];
double go[N][N], val[N], cur[N][N], sum[N];;
vector<int> p[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N; ++j)
            if (i != j)
                d[i][j] = 1e9;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        --u, --v;
        deg[u]++; deg[v]++;
        d[u][v] = d[v][u] = mat[u][v] = mat[v][u] = 1;
    }
    for (int k = 0; k < n; ++k)
        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    double best = 0;
    for (int st = 0; st < n; ++st) {
        double res = 0;
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < N; ++j)
                go[i][j] = 0;
            p[i].clear();
        }

        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j) if (mat[i][j])
                go[i][d[st][j]] += (double) 1 / (deg[j] * 1ll * n);
        for (int i = 0; i < n; ++i) {
            p[d[st][i]].push_back(i);
        }
        for (int dis = 0; dis <= n; ++dis) {
            if (p[dis].size() <= 1) {
                res += (double) p[dis].size() / n;
                continue;
            }
            double mx = 0;
            vector<pair<int, int>> c;
            for (int see = dis - 1; see <= dis + 1; ++see) if (see >= 0) {
                for (int v : p[see])
                    for (int u = 0; u < n; ++u) {
                 //       val[u] -= cur[u][d[u][v]];
                        cnt[u][d[u][v]] += go[v][dis];
                        sum[u] += go[v][dis];
                        cur[u][d[u][v]] = max(cur[u][d[u][v]], go[v][dis]);
                        c.push_back(make_pair(u, d[u][v]));
               //         val[u] += cur[u][d[u][v]];
                    }

            }
            for (pair<int, int> x : c) {
                int u = x.first;
                if (cur[x.first][x.second] != 0) {
                    val[u] += cur[x.first][x.second]  * cnt[u][x.second] / sum[u];
                //    cout << sum[u] << endl;
                }
                cur[x.first][x.second] = 0;
                cnt[x.first][x.second] = 0;
            }
            for (int v = 0; v < n; ++v) {
                mx = max(mx, val[v]);
              //  cout << st << ' ' << v << ' ' << val[v] << endl;
                sum[v] = 0;
                val[v] = 0;
            }
            res += max((double) p[dis].size(), mx * (double) p[dis].size()) / n;
        }
   //     cout << st << ' ' << res << endl;
        best = max(res, best);
    }
    cout << setprecision(10) << fixed << best << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for (int i=s;i<=t;i++)
#define pi acos(-1)
#define FOR(i,s,t) for (int i = s; i < t; i++)
typedef long long LL;
typedef long double LD;
typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef pair<PII, PII> PPP;
typedef pair<PII, int> PPI;
typedef pair<LL, PII> PLP;
typedef pair<double, PII> PDP;
#define repp(i,s,t) for (int i=s;i>=t;i--)
template<class T> T sqr(T x) {return x*x;}
#define debug(x) cerr<<#x"="<<(x)<<endl;
#define pb(x) push_back(x);
#define ori(x) x-'a'
#define y0 AERGAEWFAWERAw
#define y1 ASDFAEWRWERWERW
#define x0 gggsdfsfsfdf
#define x1 SAFREWRREWR
double ans, ret;
const int maxn = 501;
double prob[maxn], MaxProB[maxn];
vector<int> g[maxn];
vector<int> lev[maxn];
int n, m, x, y;
int f[maxn][maxn];
int vis[maxn], visit[maxn];
inline void update(double &x, double y)
{
	if (x < y) x = y;
}
inline double trans(int k)
{
	if (lev[k].size() == 1) return 1.0;
	double ret = 0;
	rep(i,1,n) vis[i] = 0;
	vector<int> v1;
	FOR(i,0,lev[k].size())
	{
		int u = lev[k][i];
		FOR(j,0,g[u].size())
		{
			int v = g[u][j];
			if (!vis[v])
			{
				prob[v] = 0;
				vis[v] = 1;
				v1.push_back(v);
			}
			prob[v] += 1.0 / lev[k].size() / g[u].size();
		}
	}
	int now = 0;
	FOR(i,0,n) visit[i] = 0, MaxProB[i] = 0;
	rep(i,1,n)
	{
		now++;
		FOR(j,0,v1.size())
		{
			int v = v1[j];
			if (visit[f[i][v]] != now)
			{
				visit[f[i][v]] = now;
				MaxProB[f[i][v]] = 0;
			}
			update(MaxProB[f[i][v]], prob[v]);
		}
		double tmp = 0;
		FOR(i,0,n) if (visit[i] == now)
			tmp += MaxProB[i];
		update(ret, tmp);
	}
	return max(1.0/n, ret);
}
double work(int k)
{
	rep(i,0,n) lev[i].clear();
	rep(i,1,n)
		lev[f[i][k]].push_back(i);
	double ret = 0;
	rep(i,0,n) if (!lev[i].empty())
		ret += 1.0 / n * lev[i].size() * trans(i);
	return ret;
}
int main()
{
	scanf("%d%d",&n,&m);
	rep(i,1,n) rep(j,1,n) f[i][j] = n;
	rep(i,1,n) f[i][i] = 0;
	rep(i,1,m)
	{
		scanf("%d%d",&x,&y);
		f[x][y] = f[y][x] = 1;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	rep(k,1,n) rep(i,1,n) rep(j,1,n)
		if (f[i][k] + f[k][j] < f[i][j]) f[i][j] = f[i][k] + f[k][j];
	double ans = 0;
	rep(i,1,n)
		update(ans, work(i));
	printf("%.10f\n", ans);
}

#include <bits/stdc++.h>
using namespace std;

const int N = 401;

int dist[N][N];
vector<int> g[N];
vector<int> lay[N];
double tmppos[N];
double pos[N];
int n;

void bfs(int start)
{
    for(int i = 1; i <= n; i++)
        dist[start][i] = N;
    dist[start][start] = 0;
    queue<int> q;
    q.push(start);
    while(!q.empty())
    {
        int v = q.front();
        q.pop();
        for(int u: g[v])
            if(dist[start][u] == N)
            {
                dist[start][u] = dist[start][v] + 1;
                q.push(u);
            }
    }
}

int main()
{
    int m;
    scanf("%d %d", &n, &m);
    while(m--)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(int i = 1; i <= n; i++)
        bfs(i);
    double ans = 0;
    for(int i = 1; i <= n; i++)
    {
        double pr = 0;
        for(int j = 0; j < n; j++)
            lay[j].clear();
        for(int j = 1; j <= n; j++)
            lay[dist[i][j]].push_back(j);
        for(int j = 0; j < n; j++)
        {
            int k = lay[j].size();
            if(k == 0) continue;
            if(k == 1)
            {
                pr += 1.0 / n;
                continue;
            }
            vector<int> vec;
            for(int v: lay[j])
                for(int u: g[v])
                {
                    if(pos[u] == 0)
                        vec.push_back(u);
                    pos[u] += 1.0 / g[v].size();
                }
            double best = 0;
            for(int v = 1; v <= n; v++)
            {
                for(int u: vec)
                {
                    int d = dist[v][u];
                    tmppos[d] = max(tmppos[d], pos[u]);
                }
                double sum = 0;
                for(int u: vec)
                {
                    int d = dist[v][u];
                    sum += tmppos[d];
                    tmppos[d] = 0;
                }
                best = max(best, sum);
            }
            for(int v: vec)
                pos[v] = 0;
            pr += best / n;
        }
        ans = max(ans, pr);
    }
    printf("%.10lf\n", ans);
}

#include<bits/stdc++.h>
#define ld double
using namespace std;
const int maxn=400+10;
int lau[maxn][maxn],f[maxn][maxn],cnt[maxn],n,m,vis[maxn],sign;
double ans,pro[maxn],dpro[maxn][maxn],sum[maxn];
vector<int> g[maxn];
vector<int> h[maxn];
void update(int p,int len,ld pr)
{
  if(lau[p][len]!=sign)
  {
	lau[p][len]=sign;
    dpro[p][len]=0;
  }
  if(dpro[p][len]<pr)
  {
	sum[p]+=pr-dpro[p][len];
    dpro[p][len]=pr;
  }
}
double solve(int p)
{
  for(int i=0;i<n;i++)
  {
	cnt[i]=0;
    g[i].clear();
  }
  for(int i=1;i<=n;i++)
  {
	cnt[f[p][i]]++;
    g[f[p][i]].push_back(i);
  }
  ld res=0;
  memset(dpro,0,sizeof(dpro));
  memset(lau,0,sizeof(lau));
  for(int i=0;i<n;i++)
  {
	double v=(ld)cnt[i]/n;ld maxi=0;
    /*if(cnt[i]==1)
    {
      res+=(ld)1/n;
      continue;
    }*/
    memset(vis,0,sizeof(vis));
    memset(pro,0,sizeof(pro));
    memset(sum,0,sizeof(sum));
    sign=i;
    for(int j=0;j<g[i].size();j++)
    {
	  int u=g[i][j],num=h[u].size();
      for(int k=0;k<h[u].size();k++)
      {
	    int hm=h[u][k],dis=f[p][hm];
        if(vis[hm]!=i)
        {
	      vis[hm]=i;
          pro[hm]=0;
        }
        pro[hm]+=(ld)1.0/(ld)(num);
      }
    }
    for(int j=1;j<=n;j++)
      if(vis[j]==i)
        for(int k=1;k<=n;k++)
          update(k,f[j][k],pro[j]);
    for(int i=1;i<=n;i++) maxi=max(maxi,sum[i]);
	res+=maxi/n*1.0;
  }
  //cout<<res<<endl;
  return res;
}
int main()
{
  //freopen("D.in","r",stdin);
  scanf("%d%d",&n,&m);
  memset(f,127/2,sizeof(f));
  for(int i=1;i<=m;i++)
  {
	int x,y;scanf("%d%d",&x,&y);
    f[x][y]=f[y][x]=1;
    h[x].push_back(y);h[y].push_back(x);
  }
  for(int i=1;i<=n;i++) f[i][i]=0;
  for(int k=1;k<=n;k++)
    for(int i=1;i<=n;i++)
      for(int j=1;j<=n;j++)
        if(i!=k&&k!=j&&i!=j)
          f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
  for(int i=1;i<=n;i++) ans=max(ans,solve(i));
  printf("%.9lf\n",ans);
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int maxn = 405;
int d[maxn][maxn],n,m;
double dis[maxn];
double posi[maxn];
vector<int> E[maxn];
vector<int> f;
void TAT()
{
    memset(d,127,sizeof(127));
}
double next(int p,int di)
{
    double ans = 0;
    memset(posi,0,sizeof(posi));

    for(int i=1;i<=n;i++)
    {
        if(d[p][i]==di)
            for(auto v:E[i])
                posi[v]+=1./n/E[i].size();
    }

    f.clear();

    for(int i=1;i<=n;i++)
        if(posi[i]>eps)
            f.push_back(i);

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(auto v:f)
            dis[d[i][v]]=max(dis[d[i][v]],posi[v]);
        for(auto v:f)
        {
            tmp+=dis[d[i][v]];
            dis[d[i][v]]=0;
        }
        ans=max(ans,tmp);
    }
    return ans;
}
void QAQ()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        d[a][b]=1;
        d[b][a]=1;
        E[a].push_back(b);
        E[b].push_back(a);
    }
    for(int i=1;i<=n;i++)
        d[i][i]=0;

    for(int k=1;k<=n;k++)
        for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);

    double ans = 0;

    for(int i=1;i<=n;i++)
    {
        double tmp = 0;
        for(int dis=0;dis<n;dis++)
        {
            int cnt = 0;
            for(int j=1;j<=n;j++)if(d[i][j]==dis)cnt++;
            if(cnt==0)continue;
            double day1 = 1./n;
            double day2 = next(i,dis);
            tmp+=max(day1,day2);
        }
        ans=max(ans,tmp);
    }
    printf("%.12f\n",ans);
}
int main()
{
    TAT();
    QAQ();
    return 0;
}

//In the Name of God
//Ya Ali

#include<bits/stdc++.h>

#define ld long double

#define pb push_back

#define id second
#define val first

#define err(A) cout<<#A<<" = "<<(A)<<endl

using namespace std;

const int maxn=404;

int n,m;

vector<int> g[maxn];

vector<int> q,G;

int dis[maxn][maxn];

ld p[maxn],P;
pair<ld,int> mxp[maxn];

ld ans;

void bfs(int s)
{
  dis[s][s]=0;
  q.resize(0);
  q.pb(s);
  for(int v,i=0;i<q.size();i++)
    {
      v=q[i];
      for(int u:g[v])
	if(dis[s][v]+1<dis[s][u])
	  {
	    dis[s][u]=dis[s][v]+1;
	    q.pb(u);
	  }
    }
}

ld f(int v)
{
  //cout<<"f("<<v+1<<")"<<endl;

  ld ret=0;
  for(int d=0;d<n;d++)
    {
      //err(d);

      G.resize(0);
      for(int i=0;i<n;i++)
	p[i]=0;

      for(int i=0;i<n;i++)
	if(dis[v][i]==d)
	  {
	    //cout<<i+1<<" ";
	    for(int j:g[i])
	      {
		if(p[j]==0)
		  G.pb(j);
		p[j]+=P/g[i].size();
	      }
	  }
      //cout<<endl;
      //err(G.size());
      //for(int c:G)
	//cout<<c+1<<" ";
      //cout<<endl;

      if(!G.size())
	break;

      for(int i=0;i<n;i++)
	mxp[i]={0,-1};
      ld X=P,x;
      for(int u=0;u<n;u++)
        {
	  x=0;
	  for(int c:G)
	    {
	      if(mxp[dis[u][c]].id==u)
		x-=p[c];
	      if(mxp[dis[u][c]].id!=u or mxp[dis[u][c]].val<p[c])
		mxp[dis[u][c]]={p[c],u};
	      if(mxp[dis[u][c]].id==u)
		x+=p[c];
	    }
	  X=max(X,x);
	}
      //err(X);
      //cout<<endl;

      ret+=X;
    }
  return ret;
}

int main()
{
  memset(dis,127,sizeof dis);

  ios::sync_with_stdio(0);cin.tie(0);

  cin>>n>>m;
  for(int v,u,i=0;i<m;i++)
    {
      cin>>v>>u;
      v--,u--;
      g[v].pb(u);
      g[u].pb(v);
    }

  for(int i=0;i<n;i++)
    bfs(i);
  P=1.0/n;
  for(int i=0;i<n;i++)
    {
      //cout<<"f("<<i<<") = "<<f(i)<<endl;
      ans=max(ans,f(i));
    }

  cout<<setprecision(15)<<fixed<<ans<<endl;

  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define MP make_pair
#define N 401

vector< vector<int> > adj(N);
vector< vector< vector<int> > > distanceList(N);
int d[N][N], n;
double p[N], s[N][N], dp[N];
bool visited[N];

void bfsTraversal(int s){
	int i, j, k;

	for(i = 0; i <= n; i++)
		d[s][i] = N;

	d[s][s] = 0;

	queue<int> q;
	q.push(s);

	while(!q.empty()){
		i = q.front();
		q.pop();

		for(j = 0; j < adj[i].size(); j++){
			k = adj[i][j];
			if(d[s][k] == N){
				d[s][k] = d[s][i] + 1;
				q.push(k);
			}
		}
	}

	for(i = 1, k = 0; i <= n; i++)
		k = max(k,d[s][i]);

	distanceList[s].resize(k + 1);

	for(i = 1; i <= n; i++)
		distanceList[s][d[s][i]].PB(i);
}

int main(){
	int m, i, j, k, x, y, z, t;
	double f, ansx, ans = 0;

	scanf("%d%d", &n, &m);

	while(m--){
		scanf("%d%d", &i, &j);
		adj[i].PB(j);
		adj[j].PB(i);
	}

	for(i = 1; i <= n; i++)
		bfsTraversal(i);

	for(i = 1; i <= n; i++){
		ansx = 0;

		for(x = 1; x < distanceList[i].size(); x++){
			for(y = 0; y < distanceList[i][x].size(); y++){
				j = distanceList[i][x][y];

				f = 1.0 / distanceList[i][x].size();
				f /= adj[j].size();

				for(z = 0; z < adj[j].size(); z++){
					k = adj[j][z];
					p[k] += f;
					visited[k] = 1;
				}
			}

			for(j = 1; j <= n; j++){
				if(visited[j] == 0)
					continue;

				for(k = 1; k <= n; k++){
					z = d[j][k];

					if(p[j] > s[k][z]){
						dp[k] += (p[j] - s[k][z]);
						s[k][z] = p[j];
					}
				}
			}

			f = 0;

			for(j = 1; j <= n; j++)
				f = max(f, dp[j]);

			ansx += (distanceList[i][x].size()  * f / n);

			for(j = 1; j <= n; j++){
				if(visited[j] == 0)
					continue;

				p[j] = 0;
				visited[j] = 0;

				for(k = 1; k <= n; k++){
					z = d[j][k];
					s[k][z] = 0;
				}
			}

			for(j = 1; j <= n; j++)
				dp[j] = 0;
		}

		ans = max(ans, ansx);
	}

	ans += (1.0 / n);

	printf("%.15lf\n", ans);

	return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <math.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int inf = 0x3f3f3f3f;

const int maxn=444;
int n,m;
vector<int> g[maxn];
vector<int> dg[maxn];
int dis[maxn][maxn];

void add_edge(int u,int v){
	g[u].push_back(v);
	g[v].push_back(u);
}

void floyd(){
	for (int u = 1; u <= n; ++u)
	{
		dis[u][u]=0;
	}

	for (int k = 1; k <= n; ++k)
	{
		for (int i = 1; i <= n; ++i)
		{
			for (int j = 1; j <= n; ++j)
			{
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

double mx[maxn];
double probability[maxn];
bool used[maxn];
vector<int> p;
double solve(vector<int> dg){
	memset(probability,0,sizeof probability);
	memset(used,false,sizeof used);
	p.clear();

	for (int i = 0; i < dg.size(); ++i)
	{
		int u=dg[i];
		for (int j = 0; j < g[u].size(); ++j)
		{
			int v=g[u][j];
			probability[v]+=1.0/n/g[u].size();
			if(used[v]==false){
				used[v]=true;
				p.push_back(v);
			}
		}
	}

	double ans=0;

	for (int i = 0; i < p.size(); ++i)
	//for(int u=1; u<=n; u++)
	{
		memset(mx,0,sizeof mx);
		int u=p[i];
		double aux=0;
		for (int j = 0; j < p.size(); ++j)
		{
			int v=p[j];
			if(mx[dis[u][v]]<probability[v]){
				aux+=probability[v]-mx[dis[u][v]];
				mx[dis[u][v]]=probability[v];
			}
		}
		ans=max(ans,aux);
	}
	return ans;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
#endif

    scanf("%d%d",&n,&m);
    memset(dis,0x3f,sizeof dis);
    for (int i = 0; i < m; ++i)
    {
    	int u,v;
    	scanf("%d%d",&u,&v);
    	add_edge(u,v);
    	dis[u][v]=dis[v][u]=1;
    }

    floyd();
    double ans=0;
    for (int i = 1; i <= n; ++i)
    {
    	double aux=1.0/n;
    	for (int j = 0; j <= n; ++j)
    	{
    		dg[j].clear();
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		dg[dis[i][j]].push_back(j);
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		if(dg[j].size()==1) aux+=1.0/n;
    		else if(dg[j].size()>1)	aux+=max(1.0/n,solve(dg[j]));
    	}
    	ans=max(ans,aux);
    }
    printf("%.12f\n",ans);
    return 0;
}

/*input
4 4
1 2
1 3
2 3
1 4
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define eb emplace_back
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define EL cout<<'\n'
#define BS(a,x) binary_search(ALL(a),x)
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
	REP(i,SZ(V)) out<<V[i]<<((i!=SZ(V)-1)?" ":"");
	return out;
}
//}}}
const ll maxn=405;
const ll maxlg=20;
const ll INF64=1e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

int dis[maxn][maxn];
double p[maxn],mx[maxn];
bitset<maxn> vis;
double mp[maxn];
int main(){
	IOS;
	int n,m;
	cin>>n>>m;
	REP(i,n) REP(j,n){
		if(i==j) dis[i][j]=0;
		else dis[i][j]=INF;
	}
	REP(i,m){
		int u,v;
		cin>>u>>v;
		u--;v--;
		dis[u][v]=dis[v][u]=1;
	}
	REP(i,n) REP(j,n) REP(k,n){
		dis[j][k]=min(dis[j][k],dis[j][i]+dis[i][k]);
	}

	double ans=0;

	REP(x,n){
		double sum=0;
		for(int d=0;d<n;d++){
			vector<int> v;
			REP(j,n) if(dis[x][j]==d) v.pb(j);

			if(SZ(v)==0) continue;

			double ans1=1.0/SZ(v);
			REP(i,n) mp[i]=0;
			vis.reset();
			vector<int> lst;
			for(int t:v){
				vector<int> tmp;
				REP(j,n) if(dis[t][j]==1) tmp.pb(j);
				for(int j:tmp){
					if(!vis[j]){
						vis[j]=0;
						lst.pb(j);
					}
					mp[j]+=1.0/SZ(v)/SZ(tmp);
				}
			}

			if(n<400) REP(y,n){
				double meow=0;
				for(auto i:lst){
					p[dis[y][i]]+=mp[i];
					meow-=mx[dis[y][i]];
					mx[dis[y][i]]=max(mx[dis[y][i]],mp[i]);
					meow+=mx[dis[y][i]];
				}
				for(auto i:lst){
					p[dis[y][i]]=0;
					mx[dis[y][i]]=0;
				}
				ans1=max(ans1,meow);
			}
			sum+=ans1*SZ(v)/n;
		}
		ans=max(ans,sum);
	}
	cout<<fixed<<setprecision(9)<<ans<<'\n';
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF (1<<29)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<"  "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define IN(n) int n;scanf("%d",&n);
#define FOR(i, m, n) for (int i(m); i < n; i++)
#define F(n) FOR(i,0,n)
#define FF(n) FOR(j,0,n)
#define FT(m, n) FOR(k, m, n)
#define aa first
#define bb second
void ga(int N,int *A){F(N)scanf("%d",A+i);}
#define MX (404)//N^4 ffs :/
struct STOP{
    clock_t S;
    void ini(){S=clock();}
    bool ok(double Z){return (clock()-S)/(double)CLOCKS_PER_SEC<Z;};
}T;
vi G[MX],D[MX][MX];
int g[MX][MX],N,M,a,b,W[MX];
double X,z[MX];
double mex(vi&d){
    double S=0,p=0;
    for(auto&h:d)S+=z[h];
    for(auto&h:d)p=max(p,z[h]/S);
    return p*S;
}
double sol(int I){
    double p=0;
    for(auto&h:D[I])if(!h.empty())p+=mex(h);
    return p;
}
double tst(vi&d){
    if(d.size()<2u)return 0;//FS
    double X=0;
    F(N)z[i]=0;
    for(auto&u:d)for(auto&h:G[u])z[h]+=1./d.size()/G[u].size();
    F(N)X=max(X,sol(i));
    return X;
}
double go(int I){
    double p=0;
    for(auto&h:D[I])if(!h.empty())p+=max(1./N,tst(h)*h.size()/N);
    return p;
}
int main(void){
    srand(time(0));
    scanf("%d%d",&N,&M),iota(W,W+N,0),random_shuffle(W,W+N),T.ini();
    F(N)FF(N)g[i][j]=i^j?INF-1:0;//init
    F(M)scanf("%d%d",&a,&b),G[--a].PB(--b),G[b].PB(a),g[a][b]=g[b][a]=1;
    FT(0,N)F(N)FF(N)g[i][j]=min(g[i][j],g[i][k]+g[k][j]);//FW
    F(N)FF(N)D[i][g[i][j]].PB(j);
    F(N&&T.ok(3.3))X=max(X,go(i));
    printf("%.10lf\n",X);
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<queue>
#include<set>
#include<stack>
#include<map>
#include<vector>
#define fi first
#define se second
#define pb push_back
#define mk make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
    x=ch-'0';
    while(1) {ch=getchar();if(ch<'0'||ch>'9') break;x=x*10+ch-'0';}
    return x*f;
}
const int maxn=1010;
int dis[maxn][maxn];
vector<int> w[maxn];
double later[maxn],dist[maxn];
bool vis[maxn];
double check(int n,int g1,int dist1)
{
    double best=0;
    for(int i=1;i<=n;i++) later[i]=0,vis[i]=0;
    vector<int> ipt;
    for(int v=1;v<=n;v++)
        if(dis[g1][v]==dist1)
            for(int b=0;b<(int)w[v].size();b++)
            {
                later[b]+=(double) 1.0/n/w[v].size();
                if(!vis[b]) vis[b]=1,ipt.pb(b);
            }
    for(int g2=1;g2<=n;g2++)
    {
        double tot=0;
        for(int b=0;b<(int)ipt.size();b++)
            dist[dis[g2][b]]=max(dist[dis[g2][b]],later[b]);
        for(int b=0;b<(int)ipt.size();b++)
        {
            tot+=dist[dis[g2][b]];
            dist[dis[g2][b]]=0;
        }
        best=max(best,tot);
    }
    return best;
}
int main()
{

  //  freopen("work.in","r",stdin);
  //  freopen("work.out","w",stdout);
    int n=read(),m=read();
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n&&j!=i;j++)
            dis[i][j]=n+1;
    for(int i=1;i<=m;i++)
    {
        int a=read(),b=read();
        w[a].pb(b);w[b].pb(a);
        dis[a][b]=dis[b][a]=1;
    }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            for(int k=1;k<=n;k++)
                dis[j][k]=min(dis[j][k],dis[j][i]+dis[i][k]);
    double ans=0;
    for(int g1=1;g1<=n;g1++)
    {
        double sum=0;

        for(int dist1=0;dist1<=n;dist1++)
        {
            int cnt=0;
            for(int i=1;i<=n;i++)
                if(dis[g1][i]==dist1) cnt++;
            if(cnt==0) continue;
            double imme=(double) 1.0/n;
            double seco=check(n,g1,dist1);
            sum+=max(imme,seco);
        }
        ans=max(ans,sum);
    }
    printf("%.12lf\n",(double)ans);
//    fclose(stdin);
  //  fclose(stdout);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define MAXN 405

int n, m;
vector<int> adj[MAXN];
vector<int> allDists[MAXN][MAXN];
int dists[MAXN][MAXN];
double cnt[MAXN] = {0};
double maxcnt[MAXN] = {0};
bool visited[MAXN] = {0};

void bfs(int source){
    int dis[MAXN];
    fill(dis, dis+MAXN, 500);
    queue<pair<int, int>> q;
    dis[source] = 0;
    q.push({source, 0});
    while(!q.empty()){
        int v = q.front().first;
        int d = q.front().second;
        q.pop();
        for(auto u : adj[v]){
            if(dis[u] == 500){
                dis[u] = d+1;
                q.push({u, dis[u]});
            }
        }
    }
    for(int i = 0; i<n; i++){
        allDists[source][dis[i]].push_back(i);
        dists[source][i] = dis[i];
    }
}

int main(){
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m;
    cout << setprecision(10) << endl;
    for(int i = 0; i<m; i++){
        int a, b; cin >> a >> b;
        --a; --b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    for(int i = 0; i<n; i++){
        bfs(i);
    }
    double ans = 0;
    for(int v = 0; v<n; v++){
        double bestv = 0;
        for(int dis = 0; dis<n; dis++){
            if(allDists[v][dis].size() == 0) continue;
            vector<int> addcnt;
            fill(cnt, cnt+MAXN, 0);
            for(auto j : allDists[v][dis]){
                for(auto i : adj[j]){
                    if(cnt[i] == 0) addcnt.push_back(i);
                    cnt[i] += 1.0/adj[j].size();
                }
            }
            double bestguess = 0;
            for(int guess = 0; guess<n; guess++){
                double cur = 0;
                for(auto x : addcnt){
                    maxcnt[dists[x][guess]] = max(maxcnt[dists[x][guess]], cnt[x]);
                }
                for(auto x : addcnt){
                    if(visited[dists[x][guess]]) continue;
                    cur += maxcnt[dists[x][guess]];
                    // cout << guess << " " << dists[x.first][guess] << " " << maxcnt[dists[x.first][guess]] << endl;
                    visited[dists[x][guess]] = 1;
                }
                bestguess = max(bestguess, cur);
                for(auto x : addcnt){
                    visited[dists[x][guess]] = 0;
                    maxcnt[dists[x][guess]] = 0;
                }
            }
            // cout << (0.0+bestguess)/tot << endl;
            bestv += max(1.0/n, (0.0+bestguess)/n);
            // cout << bestguess << " " << tot << endl;
        }
        cout << bestv << endl;
        ans = max(ans, bestv);
    }
    cout << ans << endl;
}

#include<bits/stdc++.h>
#define vi vector<int>
#define pb push_back
using namespace std;

const int inf=10000;
int n,m,d[405][405],du[405],vis[405];
double si[405],maxx[405];
vi g[405];

inline void upt(double &x,double y){
	if(y>x) x=y;
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(i==j) d[i][j]=0; else d[i][j]=inf;
	for(int i=1;i<=m;i++){
		int x,y;scanf("%d%d",&x,&y);
		d[x][y]=d[y][x]=1;
		du[x]++;du[y]++;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
	double ans=0;
	for(int i=1;i<=n;i++){
		double mx=0,tmp=0;
		int tot=0;
		for(int j=0;j<n;j++)
			g[j].clear();
		for(int j=1;j<=n;j++)
			g[d[i][j]].pb(j);
		for(int j=0;j<n;j++)
			if(g[j].size()==1) tmp+=1.0;
			else if(g[j].size()>0){
				for(int k=0;k<=n;k++) si[k]=maxx[k]=0.0;
				tot=0;
				for(int tt=0;tt<g[j].size();tt++){
					int k=g[j][tt];
					for(int l=1;l<=n;l++)
						if(d[k][l]==1) si[l]+=1.0/(double)du[k];
				}
				for(int k=1;k<=n;k++)
					if(si[k]>0) vis[++tot]=k;
				double res=0.0;
				for(int k=1;k<=n;k++){
					double t=0.0;
					for(int l=1;l<=tot;l++)
						upt(maxx[d[k][vis[l]]],si[vis[l]]);
					for(int l=1;l<=tot;l++)
						t+=maxx[d[k][vis[l]]],maxx[d[k][vis[l]]]=0;
					res=max(res,t);
				}
				tmp+=res;
			}

		ans=max(ans,tmp);
	//	printf("%.9lf\n",tmp);
	}
	printf("%.12lf\n",ans/(double)n);
	return 0;
}

#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <set>
#include <vector>
#include <list>
#include <algorithm>
#include <regex>
#include <math.h>
#include <map>
#include <iterator>
#include <climits>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <queue>
#include <stack>
#include <array>
#include <valarray>
using namespace std;
const double eps = 1e-6;
const int maxn = 400;
int d[maxn][maxn], n, m;
double dis[maxn];
double posi[maxn];
vector<int> E[maxn];
vector<int> f;
void TODAY()
{
	memset(d, 127, sizeof(127));
}
double next(int p, int di)
{
	double ans = 0;
	memset(posi, 0, sizeof(posi));

	for (int i = 1; i <= n; i++)
		if (d[p][i] == di)
			for (auto v : E[i])
				posi[v] += 1. / n / E[i].size();

	f.clear();

	for (int i = 1; i <= n; i++)
		if (posi[i]>eps)
			f.push_back(i);

	for (int i = 1; i <= n; i++)
	{
		double tmp = 0;
		for (auto v : f)
			dis[d[i][v]] = max(dis[d[i][v]], posi[v]);
		for (auto v : f)
		{
			tmp += dis[d[i][v]];
			dis[d[i][v]] = 0;
		}
		ans = max(ans, tmp);
	}
	return ans;
}
void AWAY()
{
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (i != j)d[i][j] = n + 1;
	for (int i = 1; i <= m; i++)
	{
		int a, b;
		scanf("%d%d", &a, &b);
		d[a][b] = 1;
		d[b][a] = 1;
		E[a].push_back(b);
		E[b].push_back(a);
	}

	for (int k = 1; k <= n; k++)
		for (int i = 1; i <= n; i++)
			for (int j = 1; j <= n; j++)
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);

	double ans = 0;

	for (int i = 1; i <= n; i++)
	{
		double tmp = 0;
		for (int di = 0; di<n; di++)
		{
			int cnt = 0;
			for (int j = 1; j <= n; j++)
				if (d[i][j] == di)cnt++;
			if (cnt == 0)continue;
			double day1 = 1. / n;
			double day2 = next(i, di);
			tmp += max(day1, day2);
		}
		ans = max(ans, tmp);
	}
	printf("%.12f\n", ans);
}
int main()
{
	TODAY();
	AWAY();
	return 0;
}

//*
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <functional>
#define MOD 1000000007
#define MAX 0x3f3f3f3f
#define MAX2 0x3f3f3f3f3f3f3f3fll
#define ERR 1e-10
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#pragma warning(disable:4996)
using namespace std;

typedef long long ll;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

int n, m;
vector<int> edge[500];

int dis[500][500];

int d[500];
int check[500];
vector<int> dv[500];

map<int, double> xmq[500];

int main()
{
	int i, j, k, l;
	cin>>n>>m;
	memset(dis, 0x3f, sizeof(dis));
	for(i=0;i<n;i++) dis[i][i]=0;
	for(i=0;i<m;i++)
	{
		int x, y;
		scanf("%d%d", &x, &y), x--, y--;
		edge[x].push_back(y), edge[y].push_back(x);
		dis[x][y]=dis[y][x]=1;
	}
	for(k=0;k<n;k++) for(i=0;i<n;i++) for(j=0;j<n;j++) if(dis[i][j] > dis[i][k]+dis[k][j]) dis[i][j]=dis[i][k]+dis[k][j];
	double ma=0;
	for(i=0;i<n;i++)
	{
		memset(check, 0, sizeof(check));
		for(j=0;j<n;j++) dv[j].clear();
		vector<int> q;
		check[i]=1;
		q.push_back(i);
		for(j=0;j<q.size();j++)
		{
			int now=q[j];
			for(auto e : edge[now])
			{
				if(check[e]) continue;
				check[e]=1;
				q.push_back(e);
				d[e]=d[now]+1;
			}
		}
		for(j=0;j<n;j++) dv[d[j]].push_back(j);
		double prob=0;
		for(j=0;j<n;j++)
		{
			if(dv[j].size() == 0) continue;
			double mprob=0;
			map<int, double> mq1;
			mprob=1./dv[j].size();
			for(auto e : dv[j])
			{
				for(auto f : edge[e])
				{
					mq1[f]+=1./dv[j].size()*1./edge[e].size();
				}
			}
			for(auto e : mq1)
			{
				for(k=0;k<n;k++)
				{
					xmq[k][dis[k][e.first]]=max(xmq[k][dis[k][e.first]], e.second);
				}
			}
			double xma=0;
			for(k=0;k<n;k++)
			{
				double sum=0;
				for(auto e : xmq[k])
				{
					sum+=e.second;
				}
				xmq[k].clear();
				xma=max(xma, sum);
			}
			mprob=max(mprob, xma);
			prob+=mprob*dv[j].size()/n;
		}
		ma=max(ma, prob);
	}
	printf("%.20lf", ma);
	return 0;
}
//*/

// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>

using namespace std;

#define rep(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i)
const int N = 405, mod = 0;

int d[N][N], mat[N][N], deg[N];
double cnt[N][N];
double go[N][N], val[N], cur[N][N], sum[N];;
vector<int> p[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N; ++j)
            if (i != j)
                d[i][j] = 1e9;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        --u, --v;
        deg[u]++; deg[v]++;
        d[u][v] = d[v][u] = mat[u][v] = mat[v][u] = 1;
    }
    for (int k = 0; k < n; ++k)
        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    double best = 0;
    for (int st = 0; st < n; ++st) {
        double res = 0;
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < N; ++j)
                go[i][j] = 0;
            p[i].clear();
        }

        for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j) if (mat[i][j])
                go[i][d[st][j]] += (double) 1 / (deg[j] * 1ll * n);
        for (int i = 0; i < n; ++i) {
            p[d[st][i]].push_back(i);
        }
        for (int dis = 0; dis <= n; ++dis) {
            if (p[dis].size() <= 1) {
                res += (double) p[dis].size() / n;
                continue;
            }
            double mx = 0;
            vector<pair<int, int>> c;
            for (int see = dis - 1; see <= dis + 1; ++see) if (see >= 0) {
                for (int v : p[see])
                    for (int u = 0; u < n; ++u) {
                 //       val[u] -= cur[u][d[u][v]];
                        cnt[u][d[u][v]] += go[v][dis];
                        sum[u] += go[v][dis];
                        cur[u][d[u][v]] = max(cur[u][d[u][v]], go[v][dis]);
                        c.push_back(make_pair(u, d[u][v]));
               //         val[u] += cur[u][d[u][v]];
                    }

            }
            for (pair<int, int> x : c) {
                int u = x.first;
                if (cnt[x.first][x.second] != 0)
                    val[u] += cur[x.first][x.second] / sum[u];
                cur[x.first][x.second] = 0, cnt[x.first][x.second] = 0;
            }
            for (int v = 0; v < n; ++v) {
                mx = max(mx, val[v]);
              //  cout << st << ' ' << v << ' ' << val[v] << endl;
                sum[v] = 0;
                val[v] = 0;
            }
            res += mx * (double) p[dis].size() / n;
        }
   //     cout << st << ' ' << res << endl;
        best = max(res, best);
    }
    cout << setprecision(10) << fixed << best << endl;
}

#include <bits/stdc++.h>

#define inf 0x3f3f3f3f

#define MOD 1000000007

#define pb push_back

#define sq(x) ((x)*(x))

#define x first

#define y second

#define eps 1e-9

#define bpt(x) (__builtin_popcount(x))

#define bptl(x) (__builtin_popcountll(x))

#define bit(x, y) (((x)>>(y))&1)

#define bclz(x) (__builtin_clz(x))

#define bclzl(x) (__builtin_clzll(x))

#define bctz(x) (__builtin_ctz(x))

#define bctzl(x) (__builtin_ctzll(x))

#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef long long INT;

typedef vector<int> VI;

typedef pair<int, int> pii;

typedef pair<pii, int> pi3;

typedef double DO;

template<typename T, typename U> inline void smin(T &a, U b) {if (a>b) a=b;}

template<typename T, typename U> inline void smax(T &a, U b) {if (a<b) a=b;}

template<class T>inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}

template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}

template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}

template<class T>inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}

template<class T>inline void printsp(T x) {print(x); putchar(' ');}

template<class T>inline void println(T x) {print(x); putchar('\n');}

template<class T, class U>inline void print(T x, U y) {printsp(x); println(y);}

template<class T, class U, class V>inline void print(T x, U y, V z) {printsp(x); printsp(y); println(z);}

int power(int a, int b, int m, int ans=1) {

	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;

	return ans;

}

#define NN 444

#define sz(a) ((int)a.size())

int adj[NN][NN];

int deg[NN];

int dst[NN][NN];

int md[NN];

vector<int> far[NN][NN];

int n, m;

DO p[NN][NN];

DO mx[NN][NN];

int vst[NN][NN];

int runs;

DO val[NN];

vector<int> arr[NN];

DO calc(int s) {

	DO ans=0;

	for(int i=0; i<=md[s]; i++) {

		if(sz(far[s][i]) == 1) ans += 1.0/n;

	}

	for(int i=1; i<=n; arr[i].clear(), i++) for(int j=1; j<=n; j++) p[i][j] = mx[i][j] = 0;

	for(int u=1; u<=n; u++) {

		for(int i=0; i<deg[u]; i++) {

			int v=adj[u][i];

			p[dst[s][u]][v] += 1.0/sz(far[s][dst[s][u]])/deg[u];

			arr[dst[s][u]].pb(v);

		}

	}

	//p[d][i]

	for(int d=0; d<=md[s]; d++) if(sz(far[s][d]) > 1) {

		DO tmp=0;

		runs++;

		memset(val, 0, sizeof val);

		for(int i=0; i<sz(arr[d]); i++) {

			int v=arr[d][i];

			for(int j=0; j<=md[v]; j++) {

				for(int k=0; k<sz(far[v][j]); k++) {

					int u=far[v][j][k];

					if(vst[u][j] != runs) {

						mx[u][j] = p[j][v];

						val[u] += p[j][v];

					}

					else if(mx[u][j] < p[j][v]) {

						val[u] -= mx[u][j];

						mx[u][j] = p[j][v];

						val[u] += mx[u][j];

					}

					vst[u][j] = runs;

				}

			}

		}

		for(int i=1; i<=n; i++) smax(tmp, val[i]/n);

//		cerr << tmp << endl;

		ans += max(1.0/n, tmp);

	}

	return ans;

}

int main() {

#ifndef ONLINE_JUDGE

	freopen("in.in", "r", stdin);

	freopen("out.out", "w", stdout);

#endif

	cin >> n >> m;

	memset(dst, inf, sizeof dst);

	for(int i=0; i<m; i++) {

		int u, v; gn(u, v);

		adj[u][deg[u]++] = v;

		adj[v][deg[v]++] = u;

		dst[u][v] = dst[v][u] = 1;

	}

	for(int i=1; i<=n; i++) dst[i][i] = 0;

	for(int k=1; k<=n; k++) {

		for(int i=1; i<=n; i++) {

			for(int j=1; j<=n; j++) smin(dst[i][j], dst[i][k] + dst[k][j]);

		}

	}

	for(int i=1; i<=n; i++) {

		for(int j=1; j<=n; j++) {

			smax(md[i], dst[i][j]);

//			print(i, j, dst[i][j]);

			far[i][dst[i][j]].pb(j);

		}

	}

	DO ans=0;

//	smax(ans, calc(1));

	for(int i=1; i<=n; i++) smax(ans, calc(i));

	printf("%.9lf\n", ans);

	return 0;

}

#include<bits/stdc++.h>
using namespace std;
int dis[505][505],q[505];
double b[505],c[505];
int n,m,x,y;
double ans;
int main(){
	scanf("%d%d",&n,&m);
	memset(dis,1,sizeof(dis));
	for (int i=1;i<=n;i++) dis[i][i]=0;
	for (int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		dis[x][y]=dis[y][x]=1;
	}
	for (int k=1;k<=n;k++)
		for (int i=1;i<=n;i++)
			for (int j=1;j<=n;j++)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for (int i=1;i<=n;i++){
		double r=0;
		for (int j=0;j<n;j++){
			int u=0,p=0; double t=0;
			memset(b,0,sizeof(b));
			for (int k=1;k<=n;k++)
				if (dis[i][k]==j){
					int v=0; u++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) v++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) b[l]+=1.0/v;
				}
			if (u==1){r+=1.0/n;continue;}
			for (int k=1;k<=n;k++)
				if (abs(dis[i][k]-j)<=1)
					q[++p]=k;
			for (int k=1;k<=n;k++){
				double w=0;
				for (int l=1;l<=p;l++)
					if (b[q[l]]>c[dis[k][q[l]]])
						c[dis[k][q[l]]]=b[q[l]];
				for (int l=1;l<=p;l++)
					w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				t=max(t,w);
			}
			r+=t/n;
		}
		ans=max(ans,r);
	}
	printf("%.12lf\n",ans);
}

#include <stdio.h>
#include <vector>
using namespace std;

int N,M,A[404][404],D[404][404],G[404];
double d[404],r[404]; int chk[404];
vector<int> u[404];

double prop(int l)
{
	for (int i=1;i<=N;i++) r[i] = 0;
	for (int &x : u[l]) for (int i=1;i<=N;i++) if (A[x][i]){
		r[i] += 1. / G[x];
	}

	double mx = 0;
	for (int d=0;d<N;d++) chk[d] = 0;
	for (int y=1;y<=N;y++){
		for (int i=0;i<N;i++) d[i] = 0;
		double sum = 0;
		for (int o=l-1;o<=l+1;o++) if (o >= 0){
			for (auto &i : u[o]){
				double &k = d[D[y][i]];
				if (chk[D[y][i]] != y){
					chk[D[y][i]] = y;
					k = r[i];
					sum += k;
				}
				else{
					if (k < r[i]){
						sum -= k;
						k = r[i];
						sum += k;
					}
				}
			}
		}
		if (mx < sum)
			mx = sum;
	}
	return mx;
}

int main()
{
	scanf ("%d %d",&N,&M);
	for (int i=1;i<=N;i++){
		for (int j=1;j<=N;j++) D[i][j] = 1000;
		D[i][i] = 0;
	}

	for (int i=0;i<M;i++){
		int x,y; scanf ("%d %d",&x,&y);
		A[x][y] = A[y][x] = D[x][y] = D[y][x] = 1;
		G[x]++; G[y]++;
	}

	for (int k=1;k<=N;k++) for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) if (D[i][j] > D[i][k] + D[k][j]) D[i][j] = D[i][k] + D[k][j];

	double mx = 0;
	for (int x=1;x<=N;x++){
		for (int y=1;y<=N;y++) u[D[x][y]].push_back(y);
		double sum = 0;
		for (int d=0;d<N;d++){
			double p = prop(d);
			sum += p / N;
		}
		for (int d=0;d<N;d++) u[d].clear();
		if (mx < sum)
			mx = sum;
	}
	printf ("%.12lf\n",mx);

	return 0;
}

#include <stdio.h>
#include <vector>
using namespace std;

int N,M,A[404][404],D[404][404],G[404];
double m[404],r[404]; int chk[404];
vector<int> u[404];

double prop(int l)
{
	for (int i=1;i<=N;i++) r[i] = 0;
	for (int &x : u[l]) for (int i=1;i<=N;i++) if (A[x][i]) r[i] += 1. / G[x];

	double mx = 1. / u[l].size();
	for (int d=0;d<N;d++) chk[d] = 0;
	for (int y=1;y<=N;y++){
		double sum = 0;
		for (int o=l-1;o<=l+1;o++) if (o >= 0){
			for (auto &i : u[o]){
				double &k = m[D[y][i]];
				if (chk[D[y][i]] != y){
					chk[D[y][i]] = y;
					k = r[i];
					sum += k;
				}
				else{
					if (k < r[i]){
						sum -= k;
						k = r[i];
						sum += k;
					}
				}
			}
		}
		if (mx < sum)
			mx = sum;
	}
	return mx;
}

int main()
{
	scanf ("%d %d",&N,&M);
	for (int i=1;i<=N;i++){
		for (int j=1;j<=N;j++) D[i][j] = 1000;
		D[i][i] = 0;
	}

	for (int i=0;i<M;i++){
		int x,y; scanf ("%d %d",&x,&y);
		A[x][y] = A[y][x] = D[x][y] = D[y][x] = 1;
		G[x]++; G[y]++;
	}

	for (int k=1;k<=N;k++) for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) if (D[i][j] > D[i][k] + D[k][j]) D[i][j] = D[i][k] + D[k][j];

	double mx = 0;
	for (int x=1;x<=N;x++){
		for (int y=1;y<=N;y++) u[D[x][y]].push_back(y);
		double sum = 0;
		for (int d=0;d<N;d++) if (!u[d].empty()){
			double p = prop(d);
			sum += p / N;
		}
		for (int d=0;d<N;d++) u[d].clear();
		if (mx < sum)
			mx = sum;
	}
	printf ("%.12lf\n",mx);

	return 0;
}

#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <queue>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <bitset>

using namespace std;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define epr(...) fprintf(stderr, __VA_ARGS__)
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")\n"
#define all(a) (a).begin(), (a).end()

#define equal equalll
#define less lesss
const int N = 444;
const long long INF = 1e9 + 19;

int n, m;
int a[N][N];
vector < int > e[N];
double cof[N];
int use[N];
int tmr;
//double sum[N];
double mx[N];

void read() {
	scanf("%d%d", &n, &m);
	memset(a, 63, sizeof(a));
	for (int i = 0; i < m; i++) {
		int v, u;
		scanf("%d%d", &v, &u); v--; u--;
		e[v].pb(u);
		e[u].pb(v);
		a[v][u] = a[u][v] = 1;
	}
}

void solve() {
	for (int i = 0; i < n; i++)
		a[i][i] = 0;
	for (int k = 0; k < n; k++)
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				a[i][j] = min(a[i][j], a[i][k] + a[k][j]);

	//for (int i = 0; i < n; i++, cerr << endl)
		//for (int j = 0; j < n; j++)
			//cerr << a[i][j] << " ";

	double answer = 0;

	for (int f = 0; f < n; f++) {
		vector < vector < int > > g(n);
		for (int i = 0; i < n; i++)
			g[a[f][i]].pb(i);

		double res = 0;
		for (int d = 0; d < n; d++) {
			if (g[d].empty()) continue;
			if (g[d].size() == 1) {
				res += 1.0 / n;
				continue;
			}
			double best2 = 1.0 / n / g[d].size();

			for (int i = 0; i < n; i++)
				cof[i] = 0;
			tmr++;
			for (auto v: g[d]) {
				for (auto u: e[v]) {
					cof[u] += 1.0 / n / e[v].size();
					use[u] = tmr;
				}
			}
			vector < int > who;
			for (int i = 0; i < n; i++)
				if (use[i] == tmr)
					who.pb(i);

			for (int s = 0; s < n; s++) {
				double res2 = 0;
				tmr++;
				for (auto v: who) {
					int d = a[s][v];
					if (use[d] != tmr) {
						use[d] = tmr;
						//sum[d] = 0;
						mx[d] = 0;
					}
					//sum[d] += cof[v];
					mx[d] = max(mx[d], cof[v]);
				}
				tmr++;
				for (auto v: who) {
					int d = a[s][v];
					if (use[d] != tmr) {
						use[d] = tmr;
						//assert(sum[d] > 0);
						res2 += mx[d];
					}
				}
				best2 = max(best2, res2);
			}
			res += best2;
		}

		answer = max(answer, res);

	}

	printf("%.17f\n", answer);

}

void stress() {

}

int main(){
#ifdef MY_DEBUG
    freopen("in", "r", stdin);
    //freopen("out", "w", stdout);
#endif
    if (1) {
        int k = 1;
        for (int tt = 0; tt < k; tt++) {
            read();
            solve();
        }
    }
    else {
        stress();
    }

    return 0;
}

/*
    Take me to church
    I'll worship like a dog at the shrine of your lies
    I'll tell you my sins and you can sharpen your knife
    Offer me that deathless death
    Good God, let me give you my life
*/
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
const int N = 404;
int n, m, D[N][N];
ld B[N], P[N];
vector < int > Adj[N];
int main()
{
    scanf("%d%d", &n, &m);
    memset(D, 63, sizeof(D));
    for (; m; m --)
    {
        int v, u;
        scanf("%d%d", &v, &u);
        Adj[v].push_back(u);
        Adj[u].push_back(v);
        D[v][u] = D[u][v] = 1;
    }
    for (int i = 1; i <= n; i ++)
        D[i][i] = 0;
    for (int k = 1; k <= n; k ++)
        for (int i = 1; i <= n; i ++)
            for (int j = 1; j <= n; j ++)
                D[i][j] = min(D[i][j], D[i][k] + D[k][j]);
    ld MX = 0.0;
    for (int i = 1; i <= n; i ++)
    {
        vector < int > vec[N];
        for (int j = 1; j <= n; j ++)
            vec[D[i][j]].push_back(j);
        ld SM = 1.0 / (ld)n;
        for (int j = 1; j <= n; j ++)
        {
            memset(P, 0, sizeof(P));
            vector < int > now;
            for (int v : vec[j])
                for (int u : Adj[v])
                {
                    if (P[u] == 0) now.push_back(u);
                    P[u] += 1.0 / (ld)(n * Adj[v].size());
                }
            ld MX2 = 0.0;
            for (int k = 1; k <= n; k ++)
            {
                ld SM2 = 0.0;
                for (int v : now)
                    B[D[k][v]] = max(B[D[k][v]], P[v]);
                for (int v : now)
                    SM2 += B[D[k][v]], B[D[k][v]] = 0;
                MX2 = max(MX2, SM2);
            }
            SM += MX2;
        }
        MX = max(MX, SM);
    }
    return !printf("%.10f\n", (double)MX);
}

#include <stdio.h>
#include <vector>
using namespace std;

int N,M,A[404][404],D[404][404],G[404];
double m[404],r[404]; int chk[404];
vector<int> u[404];

double prop(int l)
{
	for (int i=1;i<=N;i++) r[i] = 0;
	for (int &x : u[l]) for (int i=1;i<=N;i++) if (A[x][i]) r[i] += 1. / G[x];

	double mx = 1. / u[l].size();
	for (int d=0;d<N;d++) chk[d] = 0;
	for (int y=1;y<=N;y++){
		double sum = 0;
		for (int o=l-1;o<=l+1;o++) if (o >= 0){
			for (auto &i : u[o]){
				double &k = m[D[y][i]];
				if (chk[D[y][i]] != y){
					chk[D[y][i]] = y;
					k = r[i];
					sum += k;
				}
				else{
					if (k < r[i]){
						sum -= k;
						k = r[i];
						sum += k;
					}
				}
			}
		}
		if (mx < sum)
			mx = sum;
	}
	return mx;
}

int main()
{
	scanf ("%d %d",&N,&M);
	for (int i=1;i<=N;i++){
		for (int j=1;j<=N;j++) D[i][j] = 1000;
		D[i][i] = 0;
	}

	for (int i=0;i<M;i++){
		int x,y; scanf ("%d %d",&x,&y);
		A[x][y] = A[y][x] = D[x][y] = D[y][x] = 1;
		G[x]++; G[y]++;
	}

	for (int k=1;k<=N;k++) for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) if (D[i][j] > D[i][k] + D[k][j]) D[i][j] = D[i][k] + D[k][j];

	double mx = 0;
	for (int x=1;x<=N;x++){
		for (int y=1;y<=N;y++) u[D[x][y]].push_back(y);
		double sum = 0;
		for (int d=0;d<N;d++){
			double p = prop(d);
			sum += p / N;
		}
		for (int d=0;d<N;d++) u[d].clear();
		if (mx < sum)
			mx = sum;
	}
	printf ("%.12lf\n",mx);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int N = 401;
typedef long double ld;

int dist[N][N];
vector<int> g[N];
vector<int> lay[N];
ld tmppos[N];
ld pos[N];
int n;

void bfs(int start)
{
    for(int i = 1; i <= n; i++)
        dist[start][i] = N;
    dist[start][start] = 0;
    queue<int> q;
    q.push(start);
    while(!q.empty())
    {
        int v = q.front();
        q.pop();
        for(int u: g[v])
            if(dist[start][u] == N)
            {
                dist[start][u] = dist[start][v] + 1;
                q.push(u);
            }
    }
}

int main()
{
    int m;
    scanf("%d %d", &n, &m);
    while(m--)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(int i = 1; i <= n; i++)
        bfs(i);
    ld ans = 0;
    for(int i = 1; i <= n; i++)
    {
        ld pr = 0;
        for(int j = 0; j <= n; j++)
            lay[j].clear();
        for(int j = 1; j <= n; j++)
            lay[dist[i][j]].push_back(j);
        for(int j = 0; j <= n; j++)
        {
            int k = lay[j].size();
            if(k == 0) continue;
            if(k == 1)
            {
                pr += 1.0;
                continue;
            }
            vector<int> vec;
            for(int v: lay[j])
                for(int u: g[v])
                {
                    if(pos[u] == 0)
                        vec.push_back(u);
                    pos[u] += 1.0 / g[v].size();
                }
            ld best = 1.0 / k;
            for(int v = 1; v <= n; v++)
            {
                for(int u: vec)
                {
                    int d = dist[v][u];
                    tmppos[d] = max(tmppos[d], pos[u]);
                }
                ld sum = 0;
                for(int u: vec)
                {
                    int d = dist[v][u];
                    sum += tmppos[d];
                    tmppos[d] = 0;
                }
                best = max(best, sum);
            }
            for(int v: vec)
                pos[v] = 0;
            pr += best;
        }
        ans = max(ans, pr);
    }
    printf("%.10lf\n", (double)(ans / n));
}

#include<bits/stdc++.h>
#define vi vector<int>
#define pb push_back
using namespace std;

const int inf=10000;
int n,m,d[405][405],du[405],vis[405];
double si[405],maxx[405];
vi g[405];

inline void upt(double &x,double y){
	if(y>x) x=y;
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(i==j) d[i][j]=0; else d[i][j]=inf;
	for(int i=1;i<=m;i++){
		int x,y;scanf("%d%d",&x,&y);
		d[x][y]=d[y][x]=1;
		du[x]++;du[y]++;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
	double ans=0;
	for(int i=1;i<=n;i++){
		double mx=0,tmp=0;
		int tot=0;
		for(int j=0;j<n;j++)
			g[j].clear();
		for(int j=1;j<=n;j++)
			g[d[i][j]].pb(j);
		for(int j=0;j<n;j++)
			if(g[j].size()==1) tmp+=1.0;
			else if(g[j].size()>0){
				for(int k=0;k<=n;k++) si[k]=0;
				tot=0;
				for(int tt=0;tt<g[j].size();tt++){
					int k=g[j][tt];
					for(int l=1;l<=n;l++)
						if(d[k][l]==1) si[l]+=1.0/(double)du[k];
				}
				for(int k=1;k<=n;k++)
					if(si[k]>0.0) vis[++tot]=k;
				double res=0.0;
				for(int k=1;k<=n;k++){
					double t=0.0;
					for(int l=1;l<=tot;l++)
						upt(maxx[d[k][vis[l]]],si[vis[l]]);
					for(int l=1;l<=tot;l++)
						t+=maxx[d[k][vis[l]]],maxx[d[k][vis[l]]]=0;
					res=max(res,t);
				}
				tmp+=res;
			}

		ans=max(ans,tmp);
	//	printf("%.9lf\n",tmp);
	}
	printf("%.12lf\n",ans/(double)n);
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
#include<stdlib.h>
#include<set>
#include<map>
#include<queue>
#include<vector>
#define inf 1e9
#define mod 10007
#define N 405
#define For(i,x,y) for(int i=x;i<=y;i++)
#define Rep(i,x,y) for(int i=x;i>=y;i--)
using namespace std;
typedef long long ll;
inline int read(){int x=0,f=0;char ch=getchar();for(;ch<'0'||ch>'9';ch=getchar()) if(ch=='-') f=1;for(;ch>='0'&&ch<='9';ch=getchar()) x=(x<<1)+(x<<3)+ch-48;return f?-x:x;}
inline void write(ll x){if(x<10) putchar(x+48);else write(x/10),putchar(x%10+48);}
inline void writeln(ll x){if(x<0) putchar('-'),x=-x;write(x);putchar('\n');}
int cnt,f[N][N],n,m,head[N],in[N];
struct edge{int next,to;}e[N*N];
inline void insert(int u,int v){
	e[++cnt]=(edge){head[u],v};head[u]=cnt;in[v]++;
	e[++cnt]=(edge){head[v],u};head[v]=cnt;in[u]++;
}
double ans,a[N<<2],b[N<<2];
bool vis[N];
inline double solve(int y,int z){
	memset(vis,0,sizeof vis);
	memset(a,0,sizeof a);
	vector <int> c;
	For(i,1,n) if(f[y][i]==z){
		for(int j=head[i];j;j=e[j].next){
			a[e[j].to]+=1.0/n/in[i];
			if(!vis[e[j].to]) vis[e[j].to]=1,c.push_back(e[j].to);
		}
	}
	double mx=0;
	For(i,1,n){
		double sum=0;
		int p=c.size();
		For(j,0,p-1){
			int k=c[j];
			b[f[i][k]]=max(b[f[i][k]],a[k]);
		}
		For(j,0,p-1){
			int k=c[j];
			sum+=b[f[i][k]],b[f[i][k]]=0;
		}
		mx=max(mx,sum);
	}
	return mx;
}
int main(){
	n=read();m=read();
	For(i,1,n) For(j,1,n) if(i!=j) f[i][j]=n+1;
	For(i,1,m){
		int x=read(),y=read();
		f[x][y]=1;f[y][x]=1;
		insert(x,y);
	}
	For(k,1,n) For(i,1,n) For(j,1,n) f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	For(i,1,n){
		double sum=0;
		For(j,0,n){
			int cnt=0;
			For(k,1,n) if(f[i][k]==j) cnt++;
			if(!cnt) continue;
			sum+=max(1.0/cnt,solve(i,j));
		}
		ans=max(ans,sum);
	}
	printf("%.233lf",ans);
	return 0;
}

#include <bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=a;i<=n;++i)
#define lpd(i,a,n) for(int i=a;i>=n;--i)
#define mem(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define mod 1000000007
#define eps 1e-8
#define infi 1000000000
#define infll 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef map<int,int> mii;

const int N = 402;
int n,m,dp[N][N];
vi g[N];
double p[N],mxD[N];
bool v[N];

double solve(int s){
    double ret = 1.0 / n;
    lp(d,1,n){
        mem(p, 0);
        mem(v, 0);
        vi cur;
        lp(i,1,n) if(dp[s][i] == d){
            for(int j : g[i]){
                p[j] += 1.0 / n / sz(g[i]);
                if(!v[j]) v[j] = true, cur.pb(j);
            }
        }
        double bst = 0;
        lp(i,1,n){
            double ans = 0;
            for(int j : cur) mxD[dp[i][j]] = max(mxD[dp[i][j]], p[j]);
            for(int j : cur) ans += mxD[dp[i][j]], mxD[dp[i][j]] = 0;
            bst = max(bst, ans);
        }
        ret += bst;
    }
    return ret;
}

int main(){
    read2i(n,m);
    lp(i,1,n) lp(j,1,n) if(i != j) dp[i][j] = infi;
    lp(i,1,m){
        int x,y;
        read2i(x,y);
        g[x].pb(y);
        g[y].pb(x);
        dp[x][y] = dp[y][x] = 1;
    }
    lp(k,1,n) lp(i,1,n) lp(j,1,n)
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
    double ans = 0;
    lp(i,1,n) ans = max(ans, solve(i));
    printf("%.9f", ans);
}

/*
uniform_int_distribution<type>(l, r)(rng)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
*/

#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef double lf;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<lf, lf> pdd;
typedef complex<lf> base;

const int inf = 987654321;
const ll INF = 123456789987654321;

#define pb push_back
#define rs resize
#define cl clear
#define all(v) (v).begin(),(v).end()

FILE *fin, *fout;

int N, M;

vector<vector<int> > adj;

vector<vector<int> > dist;

void get_dist() {
    dist = vector<vector<int> >(N, vector<int>(N, inf));

    for(int i = 0; i < N; i++) {
        dist[i][i] = 0;
        for(int j = 0; j < adj[i].size(); j++) {
            dist[i][ adj[i][j] ] = 1;
        }
    }

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            for(int k = 0; k < N; k++) {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
/*
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            cout << i << ' ' << j << ' ' << dist[i][j] << endl;
        }
    }
//*/

}

vector<vector<int> > dist_cnt;

void get_dist_cnt() {
    dist_cnt = vector<vector<int> >(N, vector<int>(N + 1, 0));
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            dist_cnt[i][ dist[i][j] ]++;
        }
    }
}

vector<int> interesting;
vector<lf> prob_interesting, dist_prob;

void solve() {

    lf maxi = 0; /// will be answer

    dist_prob = vector<lf>(N + 1, 0);

    for(int g1 = 0; g1 < N; g1++) {

        lf prob = 0;

        for(int d1 = 0; d1 <= N; d1++) {

            if(dist_cnt[g1][d1] == 0) continue;
            if(dist_cnt[g1][d1] == 1) {
                prob += (lf)dist_cnt[g1][d1] / N;
                continue;
            }

            /// get interesting
            interesting.cl();
            for(int i = 0; i < N; i++) {
                if(dist[g1][i] == d1) {
                    for(int j = 0; j < adj[i].size(); j++) {
                        int k = adj[i][j];
                        interesting.pb(k);
                    }
                }
            }
            sort(all(interesting));
            interesting.rs( unique(all(interesting)) - interesting.begin() );

            /// get prob interesting
            prob_interesting.cl(), prob_interesting = vector<lf>(interesting.size(), 0);
            for(int i = 0; i < interesting.size(); i++) {
                int o = interesting[i];
                for(int j = 0; j < adj[o].size(); j++) {
                    int oo = adj[o][j];
                    if(dist[g1][oo] == d1) prob_interesting[i] += (lf)1/adj[oo].size() * (lf)1/dist_cnt[g1][d1];
                }
            }

            lf maxi2 = 0; /// will be part ans

            for(int g2 = 0; g2 < N; g2++) {

                lf prob2 = 0;

                for(int i = 0; i < interesting.size(); i++) {
                    dist_prob[ dist[g2][ interesting[i] ] ] = max(dist_prob[ dist[g2][ interesting[i] ] ], prob_interesting[i]);
                }

                for(int i = 0; i < interesting.size(); i++) {
                    prob2 += dist_prob[ dist[g2][ interesting[i] ] ];
                    dist_prob[ dist[g2][ interesting[i] ] ] = 0;
                }

                maxi2 = max(maxi2, prob2);

                //cout << g1 << ' ' << d1 << ' ' << g2 << ' ' << maxi2 << endl;
            }
            maxi2 = max(maxi2, (lf)dist_cnt[g1][d1]/N);
            prob += (lf)dist_cnt[g1][d1]/N * maxi2;
        }
        maxi = max(maxi, prob);
    }

    printf("%.20lf", maxi);
}

int main() {
    scanf("%d %d", &N, &M);

    adj.rs(N);
    for(int i = 0; i < M; i++) {
        int u, v; scanf("%d %d", &u, &v);
        u--; v--;
        adj[u].pb(v);
        adj[v].pb(u);
    }

    get_dist();
    get_dist_cnt();
    solve();
}

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>

#define CHECK(condition) if (!(condition)) { \
  printf("CHECK(%s) failed\n", #condition); \
  exit(0); \
}

typedef long long int64;

using namespace std;

#define MAX 400

int n, m;
int g[MAX][MAX];
int deg[MAX];

double Solve() {
  double ret = 0.0;
  for (int a = 0; a < n; ++a) {
    vector<int> cnt_a(n, 0);
    for (int i = 0; i < n; ++i) {
      int x = g[a][i];
      ++cnt_a[x];
    }

    vector<vector<double>> prob(n, vector<double>(n, 0.0));
    vector<set<int>> neighbour_x(n);

    for (int i = 0; i < n; ++i) {
      int x = g[a][i];
      for (int j = 0; j < n; ++j) {
        if (g[i][j] != 1) continue;
        prob[x][j] += (1.0 / cnt_a[x]) * (1.0 / deg[i]);
        neighbour_x[j].insert(x);
      }
    }

    for (int b = 0; b < n; ++b) {
      vector<map<int, pair<double, double>>> pairs(n);

      for (int i = 0; i < n; ++i) {
        int y = g[b][i];
        for (int x : neighbour_x[i]) {
          pair<double, double>& p = pairs[y][x];
          p.first += prob[x][i];
          p.second = max(p.second, prob[x][i]);
        }
      }

      vector<double> s(n, 0.0);
      for (int y = 0; y < n; ++y) {
        for (const auto& entry : pairs[y]) {
          int x = entry.first;
          s[x] += entry.second.first;
        }
      }
      vector<double> p(n, 0.0);
      for (int y = 0; y < n; ++y) {
        for (const auto& entry : pairs[y]) {
          int x = entry.first;
          p[x] += entry.second.second / entry.second.first *
                  entry.second.first / s[x];
        }
      }
      double sum_prob = 0;
      for (int x = 0; x < n; ++x) {
        if (cnt_a[x] == 0) continue;
        sum_prob += static_cast<double>(cnt_a[x]) / n *
                    max(1.0 / cnt_a[x], p[x]);
      }
      ret = max(ret, sum_prob);
    }
  }
  return ret;
}

int main() {
  CHECK(scanf("%d%d", &n, &m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      g[i][j] = MAX;
    }
    g[i][i] = 0;
  }
  for (int i = 0; i < m; ++i) {
    int a, b;
    CHECK(scanf("%d%d", &a, &b));
    ++deg[a - 1];
    ++deg[b - 1];
    g[a - 1][b - 1] = 1;
    g[b - 1][a - 1] = 1;
  }
  for (int k = 0; k < n; ++k) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
      }
    }
  }
  printf("%.10lf\n", Solve());

  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for (int i=s;i<=t;i++)
#define pi acos(-1)
#define FOR(i,s,t) for (int i = s; i < t; i++)
typedef long long LL;
typedef long double LD;
typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef pair<PII, PII> PPP;
typedef pair<PII, int> PPI;
typedef pair<LL, PII> PLP;
typedef pair<double, PII> PDP;
#define repp(i,s,t) for (int i=s;i>=t;i--)
template<class T> T sqr(T x) {return x*x;}
#define debug(x) cerr<<#x"="<<(x)<<endl;
#define pb(x) push_back(x);
#define ori(x) x-'a'
#define y0 AERGAEWFAWERAw
#define y1 ASDFAEWRWERWERW
#define x0 gggsdfsfsfdf
#define x1 SAFREWRREWR
double ans, ret;
const int maxn = 501;
double prob[maxn], MaxProB[maxn];
vector<int> g[maxn];
vector<int> lev[maxn];
int n, m, x, y;
int f[maxn][maxn];
int vis[maxn], visit[maxn];
inline void update(double &x, double y)
{
	if (x < y) x = y;
}
inline double trans(int k)
{
	if (lev[k].size() == 1) return 1.0;
	double ret = 0;
	rep(i,1,n) vis[i] = 0;
	vector<int> v1;
	FOR(i,0,lev[k].size())
	{
		int u = lev[k][i];
		FOR(j,0,g[u].size())
		{
			int v = g[u][j];
			if (!vis[v])
			{
				prob[v] = 0;
				vis[v] = 1;
				v1.push_back(v);
			}
			prob[v] += 1.0 / lev[k].size() / g[u].size();
		}
	}
	int now = 0;
	FOR(i,0,n) visit[i] = 0, MaxProB[i] = 0;
	rep(i,1,n)
	{
		now++;
		FOR(j,0,v1.size())
		{
			int v = v1[j];
			if (visit[f[i][v]] != now)
			{
				visit[f[i][v]] = now;
				MaxProB[f[i][v]] = 0;
			}
			update(MaxProB[f[i][v]], prob[v]);
		}
		double tmp = 0;
		FOR(i,0,n) if (visit[i] == now)
			tmp += MaxProB[i];
		update(ret, tmp);
	}
	return ret;
}
double work(int k)
{
	rep(i,0,n) lev[i].clear();
	rep(i,1,n)
		lev[f[i][k]].push_back(i);
	double ret = 0;
	rep(i,0,n) if (!lev[i].empty())
		ret += 1.0 / n * lev[i].size() * trans(i);
	return ret;
}
int main()
{
	scanf("%d%d",&n,&m);
	rep(i,1,n) rep(j,1,n) f[i][j] = n;
	rep(i,1,n) f[i][i] = 0;
	rep(i,1,m)
	{
		scanf("%d%d",&x,&y);
		f[x][y] = f[y][x] = 1;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	rep(k,1,n) rep(i,1,n) rep(j,1,n)
		if (f[i][k] + f[k][j] < f[i][j]) f[i][j] = f[i][k] + f[k][j];
	double ans = 0;
	rep(i,1,n)
		update(ans, work(i));
	printf("%.10f\n", ans);
}

#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define ld  double
#define ll long long
//#define int long long

using namespace std;

const int MAXN = 444 , MOD = 1e9 + 7 ;

int dis[MAXN][MAXN] , n  ;

vector<int> d[MAXN][MAXN];

vector<int> adj[MAXN] ;

ld P[MAXN][MAXN] , p[MAXN][MAXN] , dp[MAXN];

inline ld inv(ld x)
{
    return 1 / x ;
}

vector < int > can [MAXN] ;

bool mark[MAXN][MAXN] ;

inline ld check(int x)
{
    memset(P,0,sizeof P) ;
    memset(p,0,sizeof p ) ;
    memset(dp,0,sizeof dp);
    memset(mark,0,sizeof mark) ;
    for(int i = 0 ; i < n ; i ++ ) can[i].clear() ;
    for(int i = 0 ; i < n ; i ++ )
        for(auto u : d[x][i])
            for(auto v : adj[u]){
                p[i][v] += inv(d[x][i].size()*adj[u].size())  ;
                if(!mark[i][v])
                    can[i].pb(v) , mark[i][v] = 1 ;
            }

    for(int i = 0 ; d[x][i].size() ; i ++ )
    {
        dp[i] = inv(d[x][i].size()) ;
        for(int y = 0 ; y < n ; y ++ )
        {
            ld Ans = 0 ;
            vector< pair<int,ld> > v ;
            for(auto u : can[i])
            {
                v.pb({dis[y][u],p[i][u]}) ;
            }
            sort(v.begin(),v.end()) ;
            int m = v.size() ;
            for(int j = 0 ; j < m ; j ++ )
            {
                int k = j ;
                ld pp = 1 , p2 = 1  ;
                while(k<m&&v[j].F==v[k].F)
                    pp *= (p2-v[k].S) , p2 -= v[k].S , k ++ ;
                k--;
                pp = 1 - pp ;
                Ans += v[k].S ;
                j = k ;
            }
            dp[i] = max(dp[i],Ans) ;
        }
    }
    ld ans = 0 ;
    for(int i = 0 ; d[x][i].size() ; i ++ )
        ans += dp[i] * d[x][i].size() * inv(n) ;
    return ans ;

}

int32_t main()
{
    ios::sync_with_stdio(0) ; cin.tie(0) ;
    memset(dis,31,sizeof dis );
    int m ;
    cin >> n >> m ;
    for(int i = 0 ; i < n ; i ++ ) dis[i][i] = 0 ;
    for(int i = 0 ; i < m ; i ++ ) {int x , y ; cin >> x >> y , dis[y-1][x-1] = dis[--x][--y] = 1 ; adj[x].pb(y) ; adj[y].pb(x); }
    for(int k = 0 ; k < n ; k ++ ) for(int i = 0 ; i < n ; i ++ ) for(int j = 0 ; j < n ; j ++ )
        dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]) ;
    for(int i = 0 ; i < n ; i ++  ) for(int j = 0 ; j < n ; j ++ ) d[i][dis[i][j]].pb(j) ;
    ld ans = 0 ;
    for(int i = 0 ; i < n ; i += 2  )
        ans = max(ans,check(i))  ;
    cout<<fixed<<setprecision(6)<<ans<<'\n';

}

#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define ld  double
#define ll long long
//#define int long long

using namespace std;

const int MAXN = 404 , MOD = 1e9 + 7 ;

int dis[MAXN][MAXN] , n  ;

vector<int> d[MAXN][MAXN];

vector<int> adj[MAXN] ;

ld p[MAXN][MAXN] , dp[MAXN];

inline ld inv(ld x)
{
    return 1 / x ;
}

vector < int > can [MAXN] ;

bool mark[MAXN][MAXN] ;

ld mx[MAXN] ;

inline ld check(int x)
{
    memset(p,0,sizeof p ) ;
    memset(mark,0,sizeof mark) ;
    for(int i = 0 ; i < n ; i ++ ) can[i].clear() ;
    for(int i = 0 ; i < n ; i ++ )
        for(auto u : d[x][i])
            for(auto v : adj[u]){
                p[i][v] += inv(d[x][i].size()*adj[u].size())  ;
                if(!mark[i][v])
                    can[i].pb(v) , mark[i][v] = 1 ;
            }

    for(int i = 0 ; d[x][i].size() ; i ++ )
    {
        dp[i] = inv(d[x][i].size()) ;
        for(int y = 0 ; y < n ; y ++ )
        {
            ld Ans = 0 ;
            vector< pair<int,ld> > v ;
            memset(mx,0,sizeof mx) ;
            for(auto u : can[i])
            {
                if(p[i][u]>mx[dis[y][u]])
                    Ans += p[i][u] - mx[dis[y][u]] , mx[dis[y][u]] = p[i][u] ;
            }

            dp[i] = max(dp[i],Ans) ;
        }
    }
    ld ans = 0 ;
    for(int i = 0 ; d[x][i].size() ; i ++ )
        ans += dp[i] * d[x][i].size() * inv(n) ;
    return ans ;

}

int32_t main()
{
    ios::sync_with_stdio(0) ; cin.tie(0) ;
    memset(dis,31,sizeof dis );
    int m ;
    cin >> n >> m ;
    for(int i = 0 ; i < n ; i ++ ) dis[i][i] = 0 ;
    for(int i = 0 ; i < m ; i ++ ) {int x , y ; cin >> x >> y , dis[y-1][x-1] = dis[--x][--y] = 1 ; adj[x].pb(y) ; adj[y].pb(x); }
    for(int k = 0 ; k < n ; k ++ ) for(int i = 0 ; i < n ; i ++ ) for(int j = 0 ; j < n ; j ++ )
        dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]) ;
    for(int i = 0 ; i < n ; i ++  ) for(int j = 0 ; j < n ; j ++ ) d[i][dis[i][j]].pb(j) ;
    ld ans = 0 ;
    for(int i = 0 ; i < n ; i += rand()&1 + 1   )
        ans = max(ans,check(i))  ;
    cout<<fixed<<setprecision(6)<<ans<<'\n';

}

#include<bits/stdc++.h>
using namespace std;
const int N=405;
int dis[N][N];
int q[N];
double f[N];
double ans;
double c[N];
int n,m;
int main()
{
	scanf("%d%d",&n,&m);
	memset(dis,127/3,sizeof(dis));
	for(int i=1;i<=n;i++)
		dis[i][i]=0;
	for(int i=1;i<=m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		dis[x][y]=1;
		dis[y][x]=1;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for(int i=1;i<=n;i++){
		double ret=0;
		for(int j=0;j<n;j++){
			int u=0,v=0;
			double tmp=0;
			memset(f,0,sizeof(f));
			for(int k=1;k<=n;k++)
				if(dis[i][k]==j){
					int x=0;
					u++;
					for(int l=1;l<=n;l++)
						if(dis[k][l]==1)
							x++;
					for(int l=1;l<=n;l++)
						if(dis[k][l]==1)
							f[l]+=1.0/x;
				}
			for(int k=1;k<=n;k++)
				if(abs(dis[i][k]-j)==1)q[++v]=k;
			for(int k=1;k<=n;k++){
				double w=0;
				for(int l=1;l<=v;l++)
					if(f[q[l]]>c[dis[k][q[l]]])
						c[dis[k][q[l]]]=f[q[l]];
				for(int l=1;l<=v;l++)
					w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				tmp=max(tmp,w);
				}
			if(u)tmp=max(tmp,1.0);
			ret+=tmp/n;
		}
	ans=max(ans,ret);
	}
	printf("%.12lf",ans);
}

#include <cstdio>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
int adj[400];
int d[400][400];
double solve3(int n, int c2, double *p) {
    double q[400] = {}, r[400] = {};
    for(int i = 0; i < n; i++) {
        q[d[c2][i]] += p[i];
        r[d[c2][i]] = max(r[d[c2][i]], p[i]);
    }
    double sum = 0;
    for(int i = 0; i < n; i++)
        if(q[i])
            sum += r[i] / q[i];
    return sum;
}
double solve2(int n, const vector<int>& e) {
    if(e.size() == 1) return 1.0;

    double p[400] = {};
    for(int i : e)
        for(int j = 0; j < n; j++)
            if(d[i][j] == 1)
                p[j] += 1.0 / adj[j];
    double ans = 1.0 / e.size();
    for(int i = 0; i < n; i++)
        ans = max(ans, solve3(n, i, p));
    return ans;
}
double solve(int n, int c1) {
    vector<int> e[400];
    for(int i = 0; i < n; i++)
        e[d[c1][i]].push_back(i);
    double ans = 0;
    for(int i = 0; i < n; i++)
        if(!e[i].empty())
            ans += solve2(n, e[i]) * e[i].size() / n;
    return ans;
}
int main(){
    int n, m;
    scanf("%d %d", &n, &m);
    for(int i = 0; i < n; i++)
        fill_n(d[i], n, 99999), d[i][i] = 0;
    for(int i = 0; i < m; i++) {
        int p, q;
        scanf("%d %d", &p, &q);
        p--, q--;
        adj[p]++, adj[q]++;
        d[p][q] = d[q][p] = 1;
    }
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < n; k++)
                if(d[i][j] > d[i][k] + d[k][j])
                    d[i][j] = d[i][k] + d[k][j];
    double ans = 0;
    for(int c1 = 0; c1 < n; c1++)
        ans = max(ans, solve(n, c1));
    printf("%f\n", ans);
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define MP make_pair
#define N 401

vector< vector<int> > adj(N);
vector< vector< vector<int> > > distanceList(N);
int d[N][N], n;
double p[N], s[N][N], dp[N];
bool visited[N];

void bfsTraversal(int s){
	int i, j, k;

	for(i = 0; i <= n; i++)
		d[s][i] = N;

	d[s][s] = 0;

	queue<int> q;
	q.push(s);

	while(!q.empty()){
		i = q.front();
		q.pop();

		for(j = 0; j < adj[i].size(); j++){
			k = adj[i][j];
			if(d[s][k] == N){
				d[s][k] = d[s][i] + 1;
				q.push(k);
			}
		}
	}

	for(i = 1, k = 0; i <= n; i++)
		k = max(k,d[s][i]);

	distanceList[s].resize(k + 1);

	for(i = 1; i <= n; i++)
		distanceList[s][d[s][i]].PB(i);
}

int main(){
	int m, i, j, k, x, y, z, t;
	double f, ansx, ans = 0;

	scanf("%d%d", &n, &m);

	while(m--){
		scanf("%d%d", &i, &j);
		adj[i].PB(j);
		adj[j].PB(i);
	}

	for(i = 1; i <= n; i++)
		bfsTraversal(i);

	for(i = 1; i <= n; i++){
		ansx = 0;

		for(x = 1; x < distanceList[i].size(); x++){
			for(y = 0; y < distanceList[i][x].size(); y++){
				j = distanceList[i][x][y];

				f = 1.0 / distanceList[i][x].size();
				f /= adj[j].size();

				for(z = 0; z < adj[j].size(); z++){
					k = adj[j][z];
					p[k] += f;
					visited[k] = 1;
				}
			}

			for(j = 1; j <= n; j++){
				if(visited[j] == 0)
					continue;

				for(k = 1; k <= n; k++){
					z = d[j][k];

					if(p[j] > s[k][z]){
						dp[k] += (p[j] - s[k][z]);
						s[k][z] = p[j];
					}
				}
			}

			f = 0;

			for(j = 1; j <= n; j++)
				f = max(f, dp[j]);

			ansx += (distanceList[i][x].size()  * f / n);

			for(j = 1; j <= n; j++){
				if(visited[j] == 0)
					continue;

				p[j] = 0;
				visited[j] = 0;

				for(k = 1; k <= n; k++){
					z = d[j][k];
					s[k][z] = 0;
				}
			}

			for(j = 1; j <= n; j++)
				dp[j] = 0;
		}

		ans = max(ans, ansx);
	}

	ans += (1.0 / n);

	printf("%.15lf\n", ans);

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
typedef double T;
const int nax = 1005;
int dist[nax][nax];
vector<int> w[nax];
T p_later[nax]; // p[v] - probability for city v in the second day
T p_dist_max[nax];
bool vis[nax];

void max_self(T & a, T b) {
	a = max(a, b);
}

T consider_tomorrow(int n, int g1, int dist1) {
	T best_tomorrow = 0;
	// we need complexity O(n * x)
	// where x denotes the number of v that |dist1-dist[g1][v]| <= 1
	for(int i = 1; i <= n; ++i) {
		p_later[i] = 0;
		vis[i] = false;
	}
	vector<int> interesting;
	for(int v = 1; v <= n; ++v) if(dist[g1][v] == dist1)
		for(int b : w[v]) {
			// Limak started in v with prob. 1/n
			// he then moved to b with prob. 1/degree[v]
			p_later[b] += (T) 1 / n / w[v].size();
			if(!vis[b]) {
				vis[b] = true;
				interesting.push_back(b);
			}
		}

	// interesting.size() <= x, where x is defined above (needed for complexity)
	for(int g2 = 1; g2 <= n; ++g2) {
		T local_sum = 0; // over situations with fixed g1, dist1, g2

		for(int b : interesting)
			max_self(p_dist_max[dist[g2][b]], p_later[b]);
		for(int b : interesting) {
			local_sum += p_dist_max[dist[g2][b]];
			p_dist_max[dist[g2][b]] = 0; // so it won't be calculated twice
		}
		max_self(best_tomorrow, local_sum);
	}
	return best_tomorrow;
}

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	FOR(i,1,n) FOR(j, 1, n) if(i != j)
		dist[i][j] = n + 1; // infinity
	FOR(i,1,m) {
		int a, b;
		scanf("%d%d", &a, &b);
		w[a].push_back(b);
		w[b].push_back(a);
		dist[a][b] = dist[b][a] = 1;
	}
	// Floyd-Warshall
	FOR(b,1,n)FOR(a,1,n)FOR(c,1,n)
		dist[a][c] = min(dist[a][c], dist[a][b] + dist[b][c]);

	// g1 is the first guess
	T answer = 0;
	FOR(g1, 1, n) {
		T sum_over_dist1 = 0;
		FOR(dist1, 0, n) {
			int cnt_cities = 0;
			FOR(i, 1, n) if(dist[g1][i] == dist1)
				++cnt_cities;
			if(cnt_cities == 0) continue; // there are no cities within distance dist1

			// 1) consider guessing immediately
			T immediately = (T) 1 / n; // how much it counts towards the answer
			// 2) consider waiting for tomorrow
			T second_day = consider_tomorrow(n, g1, dist1);
			sum_over_dist1 += max(immediately, second_day);
		}
		max_self(answer, sum_over_dist1);
	}
	printf("%.12lfn", (double) answer);
	return 0;
}

#include<bits/stdc++.h>
#define PB push_back
#define N 410
using namespace std;
int n,m,deg[N];

#define each(u) for (int e=head[u],v=li[e].v;e;e=li[e].la,v=li[e].v)
int head[N],cnt_li;
struct LI {int la,v;}li[N*N];
int add(int a,int b) {li[++cnt_li]=(LI){head[a],b};head[a]=cnt_li;++deg[a];}

int dis[N][N],qe[N];

vector<int> vec[N];

double prio[N],ans[N],S[N][N];

double run(int d) {
//	printf("%d %d\n",d,vec[d].size());
	if (d==0) return 1;

	for (int i=1;i<=n;++i) prio[i]=ans[i]=0;

	double res=0;

	int cnt_qe=0;

	for (int i=0;i<vec[d].size();++i) {
		int u=vec[d][i];
		each(u) {
			if (prio[v]==0) qe[++cnt_qe]=v;
			prio[v]+=1.0/deg[u];
		}
	}

	for (int c=1;c<=cnt_qe;++c) {
		int i=qe[c];
		for (int j=1;j<=n;++j) {
			if (prio[i]>S[j][dis[i][j]]) ans[j]+=prio[i]-S[j][dis[i][j]],S[j][dis[i][j]]=prio[i];

		}
	}

	for (int c=1;c<=cnt_qe;++c) {
		int i=qe[c];
		for (int j=1;j<=n;++j) {
			S[j][dis[i][j]]=0;
		}
	}

	for (int i=1;i<=n;++i) {
		res=max(res,ans[i]);
	}

//	for (int t=max(d-1,0);t<=d+1;++t) {
//		double Max=0,sum=0;
//		for (int i=0;i<vec[t].size();++i) {
//			sum+=prio[vec[t][i]];
//			Max=max(Max,prio[vec[t][i]]);
//		}
//		res+=Max;
//	}

//	printf("run %d %lf\n",d,res/vec[d].size());
	return res;
}

double calc(int s) {

	for (int i=0;i<n;++i) vec[i].clear();

	double res=0;
	for (int i=1;i<=n;++i) vec[dis[s][i]].PB(i);
	for (int d=0;d<n;++d) if (vec[d].size()) res+=run(d);
//	printf("%lf\n",res);
//	for (int i=1,j=1;i<=op;i=j+1) {
//		for (;dis[qe[j+1]]==dis[qe[i]];++j);
//		res+=(j-i+1)*run(i,j,dis[qe[i]]);
//	}
//	printf("%lf\n",res);
	return res/n;
}

int main()
{
	memset(dis,0x3f,sizeof(dis));
//	freopen("bear.in","r",stdin);
	scanf("%d%d",&n,&m); for (int i=1;i<=n;++i) dis[i][i]=0;
	for (int i=1,a,b;i<=m;++i) scanf("%d%d",&a,&b),add(a,b),add(b,a),dis[a][b]=dis[b][a]=1;

	for (int k=1;k<=n;++k) for (int i=1;i<=n;++i) for (int j=1;j<=n;++j) dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);

	double ans=0;
	for (int i=1;i<=n;++i) ans=max(ans,calc(i));
	printf("%.12lf\n",ans);
}

//In the Name of God
//Ya Ali

#include<bits/stdc++.h>

#define ld long double

#define pb push_back

#define id second
#define val first

#define err(A) cout<<#A<<" = "<<(A)<<endl

using namespace std;

const int maxn=404;

int n,m;

vector<int> g[maxn];

vector<int> q,G;

int dis[maxn][maxn];

ld p[maxn],P;
pair<ld,int> mxp[maxn];

ld ans;

void bfs(int s)
{
  dis[s][s]=0;
  q.resize(0);
  q.pb(s);
  for(int v,i=0;i<q.size();i++)
    {
      v=q[i];
      for(int u:g[v])
	if(dis[s][v]+1<dis[s][u])
	  {
	    dis[s][u]=dis[s][v]+1;
	    q.pb(u);
	  }
    }
}

ld f(int v)
{
  //cout<<"f("<<v+1<<")"<<endl;

  ld ret=0;
  for(int d=0;d<n;d++)
    {
      //err(d);

      G.resize(0);
      for(int i=0;i<n;i++)
	p[i]=0;

      for(int i=0;i<n;i++)
	if(dis[v][i]==d)
	  {
	    //cout<<i+1<<" ";
	    for(int j:g[i])
	      {
		if(p[j]==0)
		  G.pb(j);
		p[j]+=P/g[i].size();
	      }
	  }
      //cout<<endl;
      //err(G.size());
      //for(int c:G)
	//cout<<c+1<<" ";
      //cout<<endl;

      if(!G.size())
	break;

      for(int i=0;i<n;i++)
	mxp[i]={0,-1};
      ld X=P,x;
      for(int u=0;u<n;u++)
        {
	  x=0;
	  for(int c:G)
	    {
	      if(mxp[dis[u][c]].id==u)
		x-=mxp[dis[u][c]].val;
	      if(mxp[dis[u][c]].id!=u or mxp[dis[u][c]].val<p[c])
		mxp[dis[u][c]]={p[c],u};
	      if(mxp[dis[u][c]].id==u)
		x+=p[c];
	    }
	  X=max(X,x);
	}
      //err(X);
      //cout<<endl;

      ret+=X;
    }
  return ret;
}

int main()
{
  memset(dis,127,sizeof dis);

  ios::sync_with_stdio(0);cin.tie(0);

  cin>>n>>m;
  for(int v,u,i=0;i<m;i++)
    {
      cin>>v>>u;
      v--,u--;
      g[v].pb(u);
      g[u].pb(v);
    }

  for(int i=0;i<n;i++)
    bfs(i);
  P=1.0/n;
  for(int i=0;i<n;i++)
    {
      //cout<<"f("<<i<<") = "<<f(i)<<endl;
      ans=max(ans,f(i));
    }

  cout<<setprecision(15)<<fixed<<ans<<endl;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXSIZE=30000020;
int bufpos;
char buf[MAXSIZE];
#define NEG 0
void init(){
	#ifdef LOCAL
		freopen("D.txt","r",stdin);
	#endif
	buf[fread(buf,1,MAXSIZE,stdin)]='\0';
	bufpos=0;
}
#if NEG
int readint(){
	bool isneg;
	int val=0;
	for(;!isdigit(buf[bufpos]) && buf[bufpos]!='-';bufpos++);
	bufpos+=(isneg=buf[bufpos]=='-');
	for(;isdigit(buf[bufpos]);bufpos++)
		val=val*10+buf[bufpos]-'0';
	return isneg?-val:val;
}
#else
int readint(){
	int val=0;
	for(;!isdigit(buf[bufpos]);bufpos++);
	for(;isdigit(buf[bufpos]);bufpos++)
		val=val*10+buf[bufpos]-'0';
	return val;
}
#endif
char readchar(){
	for(;isspace(buf[bufpos]);bufpos++);
	return buf[bufpos++];
}
int readstr(char* s){
	int cur=0;
	for(;isspace(buf[bufpos]);bufpos++);
	for(;!isspace(buf[bufpos]);bufpos++)
		s[cur++]=buf[bufpos];
	s[cur]='\0';
	return cur;
}
int a[402][402];
bool vis[402];
vector<int> now;
vector<int> e[402];
double cnt[402];
double tmp[202];
int main(){
	init();
	int n=readint(),m=readint();
	memset(a,0x3f,sizeof(a));
	while(m--){
		int x=readint(),y=readint();
		a[x][y]=a[y][x]=1;
		e[x].push_back(y);
		e[y].push_back(x);
	}
	for(int i=1;i<=n;i++)
		a[i][i]=0;
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				a[i][j]=min(a[i][j],a[i][k]+a[k][j]);
	double res=0;
	for(int i=1;i<=n;i++){
		double qwq=0;
		for(int j=0;j<=n;j++){
			for(int k=1;k<=n;k++)
				if (a[i][k]==j){
					for(int o : e[k]){
						if (!tmp[o])
							now.push_back(o);
						tmp[o]+=1.0/n/e[k].size();
					}
				}
			if (!now.size())
				continue;
			double ans=1.0/n;
			for(int k=1;k<=n;k++){
				double sum=0;
				for(int o : now)
					cnt[a[k][o]]=max(cnt[a[k][o]],tmp[o]);
				for(int o : now)
					sum+=cnt[a[k][o]],cnt[a[k][o]]=0;
				ans=max(ans,sum);
			}
			for(int o : now)
				tmp[o]=0;
			now.clear();
			qwq+=ans;
		}
		res=max(res,qwq);
	}
	printf("%.10f",res);
}

#include <cstdio>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
int adj[400];
int d[400][400];
double solve3(int n, int c2, double *p) {
    double q[400] = {}, r[400] = {};
    for(int i = 0; i < n; i++) {
        q[d[c2][i]] += p[i];
        r[d[c2][i]] = max(r[d[c2][i]], p[i]);
    }
    double sum = 0;
    for(int i = 0; i < n; i++)
        sum += r[i];
    return sum;
}
double solve2(int n, const vector<int>& e) {
    if(e.size() == 1) return 1.0;

    double p[400] = {};
    for(int i : e)
        for(int j = 0; j < n; j++)
            if(d[i][j] == 1)
                p[j] += 1.0 / adj[j];
    double ans = 1.0 / e.size();
    for(int i = 0; i < n; i++)
        ans = max(ans, solve3(n, i, p));
    return ans;
}
double solve(int n, int c1) {
    vector<int> e[400];
    for(int i = 0; i < n; i++)
        e[d[c1][i]].push_back(i);
    double ans = 0;
    for(int i = 0; i < n; i++)
        if(!e[i].empty())
            ans += solve2(n, e[i]) * e[i].size() / n;
    return ans;
}
int main(){
    int n, m;
    scanf("%d %d", &n, &m);
    for(int i = 0; i < n; i++)
        fill_n(d[i], n, 99999), d[i][i] = 0;
    for(int i = 0; i < m; i++) {
        int p, q;
        scanf("%d %d", &p, &q);
        p--, q--;
        adj[p]++, adj[q]++;
        d[p][q] = d[q][p] = 1;
    }
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < n; k++)
                if(d[i][j] > d[i][k] + d[k][j])
                    d[i][j] = d[i][k] + d[k][j];
    double ans = 0;
    for(int c1 = 0; c1 < n; c1++)
        ans = max(ans, solve(n, c1));
    printf("%f\n", ans);
}

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
typedef double T;
const int nax = 1005;
int dist[nax][nax];
vector<int> w[nax];
T p_later[nax]; // p[v] - probability for city v in the second day
T p_dist_max[nax];
bool vis[nax];

void max_self(T & a, T b) {
	a = max(a, b);
}

T consider_tomorrow(int n, int g1, int dist1) {
	T best_tomorrow = 0;
	// we need complexity O(n * x)
	// where x denotes the number of v that |dist1-dist[g1][v]| <= 1
	for(int i = 1; i <= n; ++i) {
		p_later[i] = 0;
		vis[i] = false;
	}
	vector<int> interesting;
	for(int v = 1; v <= n; ++v) if(dist[g1][v] == dist1)
		for(int b : w[v]) {
			// Limak started in v with prob. 1/n
			// he then moved to b with prob. 1/degree[v]
			p_later[b] += (T) 1 / n / w[v].size();
			if(!vis[b]) {
				vis[b] = true;
				interesting.push_back(b);
			}
		}

	// interesting.size() <= x, where x is defined above (needed for complexity)
	for(int g2 = 1; g2 <= n; ++g2) {
		T local_sum = 0; // over situations with fixed g1, dist1, g2

		for(int b : interesting)
			max_self(p_dist_max[dist[g2][b]], p_later[b]);
		for(int b : interesting) {
			local_sum += p_dist_max[dist[g2][b]];
			p_dist_max[dist[g2][b]] = 0; // so it won't be calculated twice
		}
		max_self(best_tomorrow, local_sum);
	}
	return best_tomorrow;
}

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	FOR(i,1,n) FOR(j, 1, n) if(i != j)
		dist[i][j] = n + 1; // infinity
	FOR(i,1,m) {
		int a, b;
		scanf("%d%d", &a, &b);
		w[a].push_back(b);
		w[b].push_back(a);
		dist[a][b] = dist[b][a] = 1;
	}
	// Floyd-Warshall
	FOR(b,1,n)FOR(a,1,n)FOR(c,1,n)
		dist[a][c] = min(dist[a][c], dist[a][b] + dist[b][c]);

	// g1 is the first guess
	T answer = 0;
	FOR(g1, 1, n) {
		T sum_over_dist1 = 0;
		FOR(dist1, 0, n) {
			int cnt_cities = 0;
			FOR(i, 1, n) if(dist[g1][i] == dist1)
				++cnt_cities;
			if(cnt_cities == 0) continue; // there are no cities within distance dist1

			// 1) consider guessing immediately
			T immediately = (T) 1 / n; // how much it counts towards the answer
			// 2) consider waiting for tomorrow
			T second_day = consider_tomorrow(n, g1, dist1);
			sum_over_dist1 += second_day;
		}
		max_self(answer, sum_over_dist1);
	}
	printf("%.12lfn", (double) answer);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int N=404,Inf=1000000;
int n,m,a[N][N]={},d[N]={};
void init()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)
			a[i][j]=(i!=j)*Inf;
	for(int i=1,u,v;i<=m;++i)
	{
		scanf("%d%d",&u,&v);
		++d[u],++d[v];
		a[u][v]=a[v][u]=1;
	}
	for(int k=1;k<=n;++k)
		for(int i=1;i<=n;++i)
			for(int j=1;j<=n;++j)
				a[i][j]=min(a[i][j],a[i][k]+a[k][j]);
}
void work()
{
	double ans=0.0,e=1.0/n;
	for(int s1=1;s1<=n;++s1)
	{
		double sum=0;
		for(int dis=1;dis<n;++dis)
		{
			bool in[N]={};
			double p[N]={},sp[N]={};
			int now[N]={},tot=0;
			for(int i=1;i<=n;++i)
				if(a[s1][i]==dis)
					for(int j=1;j<=n;++j)
						if(a[i][j]==1)
						{
							in[j]=true;
							p[j]+=e/d[i];
						}
			for(int i=1;i<=n;++i)
				if(in[i])
					now[++tot]=i;
			double tmp=0;
			for(int s2=1;s2<=n;++s2)
			{
				double ts=0;
				for(int i=1;i<=tot;++i)
					sp[a[s2][now[i]]]=max(sp[a[s2][now[i]]],p[now[i]]);
				for(int i=1;i<=tot;++i)
					ts+=sp[a[s2][now[i]]],sp[a[s2][now[i]]]=0;
				tmp=max(tmp,ts);
			}
			sum+=tmp;
		}
		ans=max(ans,sum+e);
	}
	printf("%.12f\n",ans);
}
int main()
{
	init();
	work();
}

#include<bits/stdc++.h>
using namespace std;
int dis[505][505],q[505];
double b[505],c[505];
int n,m,x,y;
double ans;
int main(){
	scanf("%d%d",&n,&m);
	memset(dis,1,sizeof(dis));
	for (int i=1;i<=n;i++) dis[i][i]=0;
	for (int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		dis[x][y]=dis[y][x]=1;
	}
	for (int k=1;k<=n;k++)
		for (int i=1;i<=n;i++)
			for (int j=1;j<=n;j++)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for (int i=1;i<=n;i++){
		double r=0;
		for (int j=0;j<n;j++){
			int u=0,p=0; double t=0;
			memset(b,0,sizeof(b));
			for (int k=1;k<=n;k++)
				if (dis[i][k]==j){
					int v=0; u++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) v++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) b[l]+=1.0/v;
				}
			for (int k=1;k<=n;k++)
				if (abs(dis[i][k]-j)<=1)
					q[++p]=k;
			for (int k=1;k<=n;k++){
				double w=0;
				for (int l=1;l<=p;l++)
					if (b[q[l]]>c[dis[k][q[l]]])
						c[dis[k][q[l]]]=b[q[l]];
				for (int l=1;l<=p;l++)
					w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				t=max(t,w);
			}
			if (u==1) t=max(t,1.0);
			r+=t/n;

		}
		ans=max(ans,r);
	}
	printf("%.12lf\n",ans);
}

#include <bits/stdc++.h>
using namespace std;

const int N = 401;
typedef long double ld;

int dist[N][N];
vector<int> g[N];
vector<int> lay[N];
ld tmppos[N];
ld pos[N];
int n;

void bfs(int start)
{
    for(int i = 1; i <= n; i++)
        dist[start][i] = N;
    dist[start][start] = 0;
    queue<int> q;
    q.push(start);
    while(!q.empty())
    {
        int v = q.front();
        q.pop();
        for(int u: g[v])
            if(dist[start][u] == N)
            {
                dist[start][u] = dist[start][v] + 1;
                q.push(u);
            }
    }
}

int main()
{
    int m;
    scanf("%d %d", &n, &m);
    while(m--)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(int i = 1; i <= n; i++)
        bfs(i);
    ld ans = 0;
    for(int i = 1; i <= n; i++)
    {
        ld pr = 0;
        for(int j = 0; j < n; j++)
            lay[j].clear();
        for(int j = 1; j <= n; j++)
            lay[dist[i][j]].push_back(j);
        for(int j = 0; j < n; j++)
        {
            int k = lay[j].size();
            if(k == 0) continue;
            if(k == 1)
            {
                pr += 1.0;
                continue;
            }
            vector<int> vec;
            for(int v: lay[j])
                for(int u: g[v])
                {
                    if(pos[u] == 0)
                        vec.push_back(u);
                    pos[u] += 1.0 / g[v].size();
                }
            ld best = 0;
            for(int v = 1; v <= n; v++)
            {
                for(int u: vec)
                {
                    int d = dist[v][u];
                    tmppos[d] = max(tmppos[d], pos[u]);
                }
                ld sum = 0;
                for(int u: vec)
                {
                    int d = dist[v][u];
                    sum += tmppos[d];
                    tmppos[d] = 0;
                }
                best = max(best, sum);
            }
            for(int v: vec)
                pos[v] = 0;
            pr += best;
        }
        ans = max(ans, pr);
    }
    printf("%.15Lf\n", ans / n);
}

#include<bits/stdc++.h>
#define ld double
using namespace std;
const int maxn=400+10;
int lau[maxn][maxn],f[maxn][maxn],cnt[maxn],n,m,vis[maxn],sign;
double ans,pro[maxn],dpro[maxn][maxn],sum[maxn];
vector<int> g[maxn];
vector<int> h[maxn];
void update(int p,int len,ld pr)
{
  if(lau[p][len]!=sign)
  {
	lau[p][len]=sign;
    dpro[p][len]=0;
  }
  if(dpro[p][len]<pr)
  {
	sum[p]+=pr-dpro[p][len];
    dpro[p][len]=pr;
  }
}
double solve(int p)
{
  for(int i=0;i<n;i++)
  {
	cnt[i]=0;
    g[i].clear();
  }
  for(int i=1;i<=n;i++)
  {
	cnt[f[p][i]]++;
    g[f[p][i]].push_back(i);
  }
  ld res=0;
  memset(dpro,0,sizeof(dpro));
  memset(lau,0,sizeof(lau));
  for(int i=0;i<n;i++)
  {
	double v=(ld)cnt[i]/n;ld maxi=0;
    /*if(cnt[i]==1)
    {
      res+=(ld)1/n;
      continue;
    }*/
    memset(vis,0,sizeof(vis));
    memset(pro,0,sizeof(pro));
    memset(sum,0,sizeof(sum));
    sign=i;
    for(int j=0;j<g[i].size();j++)
    {
	  int u=g[i][j],num=h[u].size();
      for(int k=0;k<h[u].size();k++)
      {
	    int hm=h[u][k],dis=f[p][hm];
        if(vis[hm]!=i)
        {
	      vis[hm]=i;
          pro[hm]=0;
        }
        pro[hm]+=(ld)1.0/(ld)(num);
      }
    }
    for(int j=1;j<=n;j++)
      if(vis[j]==i)
        for(int k=1;k<=n;k++)
          update(k,f[j][k],pro[j]);
    for(int i=1;i<=n;i++) maxi=max(maxi,sum[i]);
	res+=maxi/n*1.0;
  }
  //cout<<res<<endl;
  return res;
}
int main()
{
  //freopen("D.in","r",stdin);
  scanf("%d%d",&n,&m);
  memset(f,127/2,sizeof(f));
  for(int i=1;i<=m;i++)
  {
	int x,y;scanf("%d%d",&x,&y);
    f[x][y]=f[y][x]=1;
    h[x].push_back(y);h[y].push_back(x);
  }
  for(int i=1;i<=n;i++) f[i][i]=0;
  for(int k=1;k<=n;k++)
    for(int i=1;i<=n;i++)
      for(int j=1;j<=n;j++)
        if(i!=k&&k!=j&&i!=j)
          f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
  for(int i=1;i<=n;i++) ans=max(ans,solve(i));
  printf("%.9lf\n",ans);
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int N = 401;
typedef long double ld;

int dist[N][N];
vector<int> g[N];
vector<int> lay[N];
ld tmppos[N];
ld pos[N];
int n;

void bfs(int start)
{
    for(int i = 1; i <= n; i++)
        dist[start][i] = N;
    dist[start][start] = 0;
    queue<int> q;
    q.push(start);
    while(!q.empty())
    {
        int v = q.front();
        q.pop();
        for(int u: g[v])
            if(dist[start][u] == N)
            {
                dist[start][u] = dist[start][v] + 1;
                q.push(u);
            }
    }
}

int main()
{
    int m;
    scanf("%d %d", &n, &m);
    while(m--)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(int i = 1; i <= n; i++)
        bfs(i);
    ld ans = 0;
    for(int i = 1; i <= n; i++)
    {
        ld pr = 0;
        for(int j = 0; j <= n; j++)
            lay[j].clear();
        for(int j = 1; j <= n; j++)
            lay[dist[i][j]].push_back(j);
        for(int j = 0; j <= n; j++)
        {
            int k = lay[j].size();
            if(k == 0) continue;
            if(k == 1)
            {
                pr += 1.0;
                continue;
            }
            vector<int> vec;
            for(int v: lay[j])
                for(int u: g[v])
                {
                    if(pos[u] == 0)
                        vec.push_back(u);
                    pos[u] += 1.0 / g[v].size();
                }
            ld best = 1.0 / k;
            for(int v = 1; v <= n; v++)
            {
                for(int u: vec)
                {
                    int d = dist[v][u];
                    tmppos[d] = max(tmppos[d], pos[u]);
                }
                ld sum = 0;
                for(int u: vec)
                {
                    int d = dist[v][u];
                    sum += tmppos[d];
                    tmppos[d] = 0;
                }
                best = max(best, sum);
            }
            for(int v: vec)
                pos[v] = 0;
            pr += best;
        }
        ans = max(ans, pr);
    }
    printf("%.10lf\n", (double)(ans / n));
}

#include <bits/stdc++.h>
using namespace std;

#define jjs(i, s, x) for (int i = (s); i < int(x); ++i)
#define jjl(i, x) jjs(i, 0, x)
#define ji(x) jjl(i, x)
#define jj(x) jjl(j, x)
#define jk(x) jjl(k, x)
#define jij(a, b) ji(a) jj(b)
#define jjdescent(i, s, e) for (int i = (s)-1; i >= int(e); --i)
#define jjrev(i, s) jjdescent(i, s, 0)
#define foreach(x, C) for (auto& x : (C))
#define INF ((int) 1e9+10)
#define LINF ((long long) 1e16)
#define pb push_back
#define mp make_pair

#define rint readInteger
template<typename T>
bool readInteger(T& x)
{
	char c, r = 0, n = 0;
	x = 0;
	while (true)
	{
		c = getchar();
		if (c < 0 && !r)
			return 0;
		else if (c == '-' && !r)
			n = 1;
		else if (c >= '0' && c <= '9')
			x = x * 10 + c - '0', r = 1;
		else if (r)
			break;
	}
	if (n)
		x = -x;
	return 1;
}

template<typename T>
vector<T> readIntegral(int n)
{
	vector<T> ret(n);
	for (int i = 0; i < n; i++)
		readInteger(ret[i]);
	return ret;
}

auto readInts = readIntegral<int>;
auto readLongs = readIntegral<long long>;

template <typename T, T MOD>
struct ModInt
{
	T value;
	ModInt() : value(0)
	{}
	ModInt(T x)
	{
		x %= MOD;
		if (x < 0)
			x += MOD;
		value = x;
	}

public:
	ModInt& operator += (ModInt x)
	{
		value += x.value;
		if (value >= MOD)
			value -= MOD;
		return *this;
	}
	ModInt& operator -= (ModInt x)
	{
		value -= x.value;
		if (value < 0)
			value += MOD;
		return *this;
	}
	ModInt& operator *= (ModInt x)
	{
		value *= x.value;
		value %= MOD;
		return *this;
	}
	ModInt& operator /= (ModInt x)
	{
		x.invert();
		return *this *= x;
	}

	ModInt operator + (ModInt x) const
	{
		ModInt o = *this;
		o += x;
		return o;
	}
	ModInt operator - (ModInt x) const
	{
		ModInt o = *this;
		o -= x;
		return o;
	}
	ModInt operator * (ModInt x) const
	{
		ModInt o = *this;
		o *= x;
		return o;
	}
	ModInt operator / (ModInt x) const
	{
		ModInt o = *this;
		o /= x;
		return o;
	}
	bool operator == (ModInt x) const
	{
		return value == x.value;
	}
	bool operator != (ModInt x) const
	{
		return !(*this == x);
	}

	ModInt operator - () const
	{
		return ModInt(0) - *this;
	}

	ModInt operator ^ (long long x) const
	{
		ModInt ret = 1 % MOD;
		ModInt mul = *this;
		while (x)
		{
			if (x & 1)
				ret *= mul;
			mul *= mul;
			x >>= 1;
		}
		return ret;
	}
	ModInt& operator ^= (long long x)
	{
		return *this = *this ^ x;
	}

private:
	void invert()
	{
		*this ^= MOD-2;
	}
public:
	void answer()
	{
		std::cout << value << std::endl;
	}
};

typedef ModInt<long long, 1000000007> mint;
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<double> VD;

const int MX = 405;

VI E[MX];
int D[MX][MX];

int n, m;

template<typename T>
void uniquify(vector<T>& v)
{
	sort(v.begin(), v.end());
	v.resize(unique(v.begin(), v.end()) - v.begin());
}

vector<pair<int, double>> process(vector<pair<int, double>>& v)
{
	vector<pair<int, double>> ret;
	sort(v.begin(), v.end());
	foreach(pr, v) {
		if (ret.empty() || pr.first != ret.back().first) {
			ret.push_back(pr);
		} else {
			ret.back().second += pr.second;
		}
	}
	return ret;
}

double dpr[MX];
int stamp[MX];

double f(int x)
{
	double base = 1.0 / n;
	VD pdist(n);
	VI countAt(n);
	ji(n) pdist[D[x][i]] += base;
	ji(n) ++countAt[D[x][i]];
	vector<vector<pair<int, double>>> possLoc(n);
	ji(n) foreach(o, E[i]) possLoc[D[x][i]].pb({o, base / E[i].size()});
	double tot = 0;
	ji(n) {
		if (countAt[i] == 0)
			continue;
		double catchChance = 1.0 / countAt[i];
		possLoc[i] = process(possLoc[i]);
		jj(n) stamp[j] = -1;
		jj(n) {
			double ccatch = 0;
			foreach(pr, possLoc[i]) {
				auto& q = dpr[D[j][pr.first]];
				if (stamp[D[j][pr.first]] != j) {
					stamp[D[j][pr.first]] = j;
					q = 0;
				}
				auto r = pr.second;
				if (r > q) {
					ccatch += r - q;
					q = r;
				}
			}
			catchChance = max(catchChance, ccatch);
		}
		tot += catchChance;
		// printf("%d %d %f %f\n", x, i, pdist[i], catchChance);
	}
	return tot;
}

int main()
{
	jij(MX, MX) D[i][j] = INF;
	rint(n); rint(m);
	ji(n) D[i][i] = 0;
	jk(m) {
		int a, b;
		rint(a); rint(b);
		--a; --b;
		D[a][b] = min(D[a][b], 1);
		D[b][a] = min(D[b][a], 1);
		E[a].pb(b);
		E[b].pb(a);
	}
	ji(n) jj(n) jk(n) D[j][k] = min(D[j][k], D[j][i] + D[i][k]);
	double ans = 0;
	ji(n) ans = max(ans, f(i));
	printf("%.10f\n", ans);
}

#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define ld  double
#define ll long long
//#define int long long

using namespace std;

const int MAXN = 404 , MOD = 1e9 + 7 ;

int dis[MAXN][MAXN] , n  ;

vector<int> d[MAXN][MAXN];

vector<int> adj[MAXN] ;

ld p[MAXN][MAXN] , dp[MAXN];

inline ld inv(ld x)
{
    return 1 / x ;
}

vector < int > can [MAXN] ;

vector<ld> v[MAXN] ;

bool mark[MAXN][MAXN] , Mark[MAXN];

inline ld check(int x)
{
    memset(p,0,sizeof p ) ;
    memset(mark,0,sizeof mark) ;
    for(int i = 0 ; i < n ; i ++ ) can[i].clear() ;
    for(int i = 0 ; i < n ; i ++ )
        for(auto u : d[x][i])
            for(auto v : adj[u]){
                p[i][v] += inv(d[x][i].size()*adj[u].size())  ;
                if(!mark[i][v])
                    can[i].pb(v) , mark[i][v] = 1 ;
            }

    for(int i = 0 ; d[x][i].size() ; i ++ )
    {
        dp[i] = inv(d[x][i].size()) ;
        for(int y = 0 ; y < n ; y ++ )
        {
            memset(Mark,0,sizeof Mark) ;
            ld Ans = 0 ;
            for(int i = 0 ; i < n ; i ++ )
                v[i].clear() ;
            vector<int> v2 ;
            for(auto u : can[i])
            {
                v[dis[y][u]].pb(p[i][u]) ;
                if(!Mark[dis[y][u]])
                    v2.pb(dis[y][u]) , Mark[dis[y][u]] = 1 ;
            }
            int m = v2.size() ;
            for(int j = 0 ; j < m ; j ++ )
            {
                ld pp = 1 , p2 = 1 , mx = 0  ;
                for(auto u : v[j])
                    pp *= (p2-u) , p2-= u , mx = max(mx,u);
                pp = 1 - pp ;

                Ans += mx ;
            }
            dp[i] = max(dp[i],Ans) ;
        }
    }
    ld ans = 0 ;
    for(int i = 0 ; d[x][i].size() ; i ++ )
        ans += dp[i] * d[x][i].size() * inv(n) ;
    return ans ;

}

int32_t main()
{
    ios::sync_with_stdio(0) ; cin.tie(0) ;
    memset(dis,31,sizeof dis );
    int m ;
    cin >> n >> m ;
    for(int i = 0 ; i < n ; i ++ ) dis[i][i] = 0 ;
    for(int i = 0 ; i < m ; i ++ ) {int x , y ; cin >> x >> y , dis[y-1][x-1] = dis[--x][--y] = 1 ; adj[x].pb(y) ; adj[y].pb(x); }
    for(int k = 0 ; k < n ; k ++ ) for(int i = 0 ; i < n ; i ++ ) for(int j = 0 ; j < n ; j ++ )
        dis[i][j] = min(dis[i][j],dis[i][k]+dis[k][j]) ;
    for(int i = 0 ; i < n ; i ++  ) for(int j = 0 ; j < n ; j ++ ) d[i][dis[i][j]].pb(j) ;
    ld ans = 0 ;
    for(int i = 0 ; i < n ; i ++ )
        ans = max(ans,check(i))  ;
    cout<<fixed<<setprecision(6)<<ans<<'\n';

}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=405;
int dis[maxn][maxn];
vector<int>g[maxn];
double vis[maxn];
bool use[maxn];
vector<int>gg,gg1;
double s1[maxn];
double s2[maxn];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            dis[i][j]=dis[j][i]=100000000;
        }
    }
    for(int i=0;i<m;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        g[x].push_back(y);
        g[y].push_back(x);
        dis[x][y]=1;
        dis[y][x]=1;
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            for(int f=1;f<=n;f++){
                dis[j][f]=min(dis[j][f],dis[j][i]+dis[i][f]);
            }
        }
    }
    double ans=0;
    for(int i=1;i<=n;i++){
        double aa=0;
        for(int j=1;j<=n;j++){
            memset(use,0,sizeof(use));
            memset(vis,0,sizeof(vis));
            gg.clear();
            for(int f=1;f<=n;f++){
                if(dis[i][f]==j){
                    int p=g[f].size();
                    for(int v:g[f]){
                        if(!use[v]){
                            gg.push_back(v);
                        }
                        vis[v]+=1.0/p*1.0/n;
                        use[v]=1;
                    }
                }
            }
            if(gg.size()==0) continue;
            memset(use,0,sizeof(use));
            double ans1=10;
            for(int f=1;f<=n;f++){
                double s=0;
                for(int v:gg){
                    if(!use[dis[f][v]]){
                        use[dis[f][v]]=1;
                        gg1.push_back(dis[f][v]);
                    }
                    s1[dis[f][v]]+=vis[v];
                    s2[dis[f][v]]=max(s2[dis[f][v]],vis[v]);
                }
                for(int v:gg1){
                    if(v!=0){
                        double p=1;
                        p=(s1[v]-s2[v]);
                        s+=p;
                    }
                    s1[v]=0;
                    s2[v]=0;
                    use[v]=0;
                }
                gg1.clear();
                ans1=min(ans1,s);
            }
            aa+=ans1;
        }
        ans=max(ans,1-aa);
    }
    printf("%.10lf\n",ans);
}

#include <bits/stdc++.h>

using namespace std;

#define REP(i, a, b) for (int i = (a), _end_ = (b); i < _end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;

const int oo = 0x3f3f3f3f;

const int maxn = 400;

int n, m;
vector<int> adj[maxn + 5];

int dis[maxn + 5][maxn + 5];

double ans;

inline void bfs(int x, int *dis)
{
	static bool vis[maxn + 5];
	memset(vis, 0, sizeof vis);
	queue<int> q; q.push(x), vis[x] = 1, dis[x] = 0;
	while (!q.empty())
	{
		int u = q.front(); q.pop();
		for (auto v : adj[u]) if (!vis[v]) vis[v] = 1, q.push(v), dis[v] = dis[u] + 1;
	}
}

double inv[maxn + 5];

int main()
{
#ifdef matthew99
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d", &n, &m);
	REP(i, 1, n + 1) inv[i] = 1. / i;
	REP(i, 0, m)
	{
		int u, v;
		scanf("%d%d", &u, &v), --u, --v;
		adj[u].pb(v), adj[v].pb(u);
	}
	REP(i, 0, n) bfs(i, dis[i]);
	ans = 0;
	REP(i, 0, n)
	{
		double tmp = 0;
		REP(j, 0, n)
		{
			static double sum[maxn + 5];
			static bool vis[maxn + 5];
			memset(sum, 0, sizeof sum);
			memset(vis, 0, sizeof vis);
			int cnt = 0;
			REP(k, 0, n) if (dis[i][k] == j)
			{
				double per = inv[SZ(adj[k])];
				for (auto l : adj[k]) sum[l] += per, vis[l] =1;
				++cnt;
			}
			if (!cnt) continue;
			vector<int> all;
			REP(k, 0, n) if (vis[k]) all.pb(k);
			double ret = 1;
			static int num[maxn + 5];
			REP(k, 0, n)
			{
				for (auto tmp : all) num[dis[k][tmp]] = 0;
				for (auto tmp : all) ++num[dis[k][tmp]];
				double foo = 0;
				for (auto tmp : all) foo += inv[num[dis[k][tmp]]] * sum[tmp];
				chkmax(ret, foo);
			}
			tmp += ret * cnt * inv[cnt];
		}
		chkmax(ans, tmp);
	}
	ans *= inv[n];
	printf("%.15f\n", ans);
	return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

typedef long double ld;

const int MAXN = 405;

int N, M;
vector <int> E[MAXN];
int dist[MAXN][MAXN];
vector <int> group[MAXN][MAXN];
ld prob[MAXN];

void load() {
    scanf("%d%d", &N, &M);
    while (M--) {
        int a, b;
        scanf("%d%d", &a, &b);
        E[a].push_back(b);
        E[b].push_back(a);
    }
}

void bfs(int source, int *d) {
    d[source] = 0;
    queue <int> Q;
    Q.push(source);
    while (!Q.empty()) {
        int x = Q.front();
        Q.pop();
        for (int i = 0; i < E[x].size(); i++) {
            int nxt = E[x][i];
            if (d[nxt] != -1) continue;
            d[nxt] = d[x] + 1;
            Q.push(nxt);
        }
    }
}

ld calc(vector <int> nodes) {
    if (nodes.empty()) return 0;
    for (int i = 1; i <= N; i++)
        prob[i] = 0;

    for (int i = 0; i < nodes.size(); i++)
        for (int j = 0; j < E[nodes[i]].size(); j++)
            prob[E[nodes[i]][j]] += (ld)1 / E[nodes[i]].size();

    ld res = (ld)1 / nodes.size();
    for (int i = 1; i <= N; i++) {
        ld sum = 0;
        for (int j = 0; j < N; j++) {
            ld maks = 0;
            for (int k = 0; k < group[i][j].size(); k++)
                maks = max(maks, prob[group[i][j][k]]);
            sum += maks;
        }
        res = max(res, sum);
    }

    return res / N;
}

ld solve() {
    memset(dist, -1, sizeof dist);
    for (int i = 1; i <= N; i++)
        bfs(i, dist[i]);

    for (int i = 1; i <= N; i++)
        for (int j = 1; j <= N; j++)
            group[i][dist[i][j]].push_back(j);

    ld sol = 0;
    for (int i = 1; i <= N; i++) {
        ld curr = 0;
        for (int j = 0; j < N; j++)
            curr += calc(group[i][j]);
        sol = max(sol, curr);
    }

    return sol;
}

int main() {
    load();
    printf("%.12lf\n", (double)solve());
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <math.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int inf = 0x3f3f3f3f;

const int maxn=444;
int n,m;
vector<int> g[maxn];
vector<int> dg[maxn];
int dis[maxn][maxn];

void add_edge(int u,int v){
	g[u].push_back(v);
	g[v].push_back(u);
}

void floyd(){
	for (int u = 1; u <= n; ++u)
	{
		dis[u][u]=0;
	}

	for (int k = 1; k <= n; ++k)
	{
		for (int i = 1; i <= n; ++i)
		{
			for (int j = 1; j <= n; ++j)
			{
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
}

double mx[maxn];
double probability[maxn];
bool used[maxn];
vector<int> p;
double solve(vector<int> dg){
	memset(probability,0,sizeof probability);
	memset(used,false,sizeof used);
	p.clear();

	for (int i = 0; i < dg.size(); ++i)
	{
		int u=dg[i];
		for (int j = 0; j < g[u].size(); ++j)
		{
			int v=g[u][j];
			probability[v]+=1.0/n/g[u].size();
			if(used[v]==false){
				used[v]=true;
				p.push_back(v);
			}
		}
	}

	double ans=0;
	//for (int i = 0; i < p.size(); ++i)
	for(int u=1; u<=n; u++)
	{
		memset(mx,0,sizeof mx);
		//int u=p[i];
		double aux=0;
		for (int j = 0; j < p.size(); ++j)
		{
			int v=p[j];
			if(mx[dis[u][v]]<probability[v]){
				aux+=probability[v]-mx[dis[u][v]];
				mx[dis[u][v]]=probability[v];
			}
		}
		ans=max(ans,aux);
	}
	return ans;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
#endif

    scanf("%d%d",&n,&m);
    memset(dis,0x3f,sizeof dis);
    for (int i = 0; i < m; ++i)
    {
    	int u,v;
    	scanf("%d%d",&u,&v);
    	add_edge(u,v);
    	dis[u][v]=dis[v][u]=1;
    }

    floyd();
    double ans=0;
    for (int i = 1; i <= n; ++i)
    {
    	double aux=1.0/n;
    	for (int j = 1; j <= n; ++j)
    	{
    		dg[j].clear();
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		dg[dis[i][j]].push_back(j);
    	}
    	for (int j = 1; j <= n; ++j)
    	{
    		aux+=solve(dg[j]);
    	}
    	ans=max(ans,aux);
    }
    printf("%.10f\n",ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
typedef double T;
const int nax = 1005;
int dist[nax][nax];
vector<int> w[nax];
T p_later[nax]; // p[v] - probability for city v in the second day
T p_dist_max[nax];
bool vis[nax];

void max_self(T & a, T b) {
	a = max(a, b);
}

T consider_tomorrow(int n, int g1, int dist1) {
	T best_tomorrow = 0;
	// we need complexity O(n * x)
	// where x denotes the number of v that |dist1-dist[g1][v]| <= 1
	for(int i = 1; i <= n; ++i) {
		p_later[i] = 0;
		vis[i] = false;
	}
	vector<int> interesting;
	for(int v = 1; v <= n; ++v) if(dist[g1][v] == dist1)
		for(int b : w[v]) {
			// Limak started in v with prob. 1/n
			// he then moved to b with prob. 1/degree[v]
			p_later[b] += (T) 1 / n / w[v].size();
			if(!vis[b]) {
				vis[b] = true;
				interesting.push_back(b);
			}
		}

	// interesting.size() <= x, where x is defined above (needed for complexity)
	for(int g2 = 1; g2 <= n; ++g2) {
		T local_sum = 0; // over situations with fixed g1, dist1, g2

		for(int b : interesting)
			max_self(p_dist_max[dist[g2][b]], p_later[b]);
		for(int b : interesting) {
			local_sum += p_dist_max[dist[g2][b]];
			p_dist_max[dist[g2][b]] = 0; // so it won't be calculated twice
		}
		max_self(best_tomorrow, local_sum);
	}
	return best_tomorrow;
}

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	FOR(i,1,n) FOR(j, 1, n) if(i != j)
		dist[i][j] = n + 1; // infinity
	FOR(i,1,m) {
		int a, b;
		scanf("%d%d", &a, &b);
		w[a].push_back(b);
		w[b].push_back(a);
		dist[a][b] = dist[b][a] = 1;
	}
	// Floyd-Warshall
	FOR(b,1,n)FOR(a,1,n)FOR(c,1,n)
		dist[a][c] = min(dist[a][c], dist[a][b] + dist[b][c]);

	// g1 is the first guess
	T answer = 0;
	FOR(g1, 1, n) {
		T sum_over_dist1 = 0;
		FOR(dist1, 0, n) {
			int cnt_cities = 0;
			FOR(i, 1, n) if(dist[g1][i] == dist1)
				++cnt_cities;
			if(cnt_cities == 0) continue; // there are no cities within distance dist1

			// 1) consider guessing immediately
			T immediately = (T) 1 / n; // how much it counts towards the answer
			// 2) consider waiting for tomorrow
			T second_day = consider_tomorrow(n, g1, dist1);
			sum_over_dist1 += max(immediately, second_day);
		}
		max_self(answer, sum_over_dist1);
	}
	return 0;
}

#include<bits/stdc++.h>
#define PB push_back
//#define double long double
#define N 410
using namespace std;
int n,m,deg[N];

#define each(u) for (int e=head[u],v=li[e].v;e;e=li[e].la,v=li[e].v)
int head[N],cnt_li;
struct LI {int la,v;}li[N*N];
int add(int a,int b) {li[++cnt_li]=(LI){head[a],b};head[a]=cnt_li;++deg[a];}

int dis[N][N],qe[N];

vector<int> vec[N];

long double prio[N],ans[N],S[N][N];

long double run(int d) {
//	printf("%d %d\n",d,vec[d].size());
//	if (d==0) return 1;

	for (int i=1;i<=n;++i) prio[i]=ans[i]=0;

	long double res=0;

	int cnt_qe=0;

	for (int i=0;i<vec[d].size();++i) {
		int u=vec[d][i];
		each(u) {
			if (prio[v]==0) qe[++cnt_qe]=v;
			prio[v]+=(long double)1.0/deg[u];
		}
	}

	for (int c=1;c<=cnt_qe;++c) {
		int i=qe[c];
		for (int j=1;j<=n;++j) {
			if (prio[i]>S[j][dis[i][j]]) ans[j]+=prio[i]-S[j][dis[i][j]],S[j][dis[i][j]]=prio[i];

		}
	}

	for (int c=1;c<=cnt_qe;++c) {
		int i=qe[c];
		for (int j=1;j<=n;++j) {
			S[j][dis[i][j]]=0;
		}
	}

	for (int i=1;i<=n;++i) {
		res=max(res,ans[i]);
	}

//	for (int t=max(d-1,0);t<=d+1;++t) {
//		double Max=0,sum=0;
//		for (int i=0;i<vec[t].size();++i) {
//			sum+=prio[vec[t][i]];
//			Max=max(Max,prio[vec[t][i]]);
//		}
//		res+=Max;
//	}

//	printf("run %d %lf\n",d,res/vec[d].size());
	return max(res,(long double)1.0/vec[d].size());
}

long double calc(int s) {

	for (int i=0;i<n;++i) vec[i].clear();

	long double res=0;
	for (int i=1;i<=n;++i) vec[dis[s][i]].PB(i);
	for (int d=0;d<n;++d) if (vec[d].size()) res+=run(d);
//	printf("%lf\n",res);
//	for (int i=1,j=1;i<=op;i=j+1) {
//		for (;dis[qe[j+1]]==dis[qe[i]];++j);
//		res+=(j-i+1)*run(i,j,dis[qe[i]]);
//	}
//	printf("%lf\n",(double)res);
	return res/n;
}

int main()
{
	memset(dis,0x3f,sizeof(dis));
//	freopen("bear.in","r",stdin);
//	freopen("bear.out","w",stdout);
	scanf("%d%d",&n,&m); for (int i=1;i<=n;++i) dis[i][i]=0;
	for (int i=1,a,b;i<=m;++i) scanf("%d%d",&a,&b),add(a,b),add(b,a),dis[a][b]=dis[b][a]=1;

	for (int k=1;k<=n;++k) for (int i=1;i<=n;++i) for (int j=1;j<=n;++j) dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);

	long double ans=0;
	for (int i=1;i<=n;++i) ans=max(ans,calc(i));
	printf("%.10lf\n",(double)ans);

//	for (int i=1;i<=n;++i) {
//		for (int j=i+1;j<=n;++j) {
//			printf("%d %d %d\n",i,j,dis[i][j]);
//		}
//	}
}

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()

int N, M;
int w[401][401];
int last[401], K;
double P1[401], P2[401], mxp[402];

int main()
{
	scanf("%d%d", &N, &M);
	for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) w[i][j] = i == j ? 0 : 1e9;
	for (int i=1;i<=M;i++){
		int a, b; scanf("%d%d", &a, &b);
		w[a][b] = w[b][a] = 1;
	}
	for (int k=1;k<=N;k++) for (int i=1;i<=N;i++) for (int j=1;j<=N;j++)
		w[i][j] = min(w[i][j], w[i][k]+w[k][j]);
	double ans = 0;
	for (int i=1;i<=N;i++){
		double now = 0;
		for (int dist=0;dist<N;dist++){
			vector <int> arr;
			for (int j=1;j<=N;j++) if (w[i][j] == dist){
				arr.pb(j);
			}
			if (!sz(arr)) continue;
			for (int j=1;j<=N;j++) P1[j] = P2[j] = 0;
			for (int t: arr) P1[t] = 1. / sz(arr);
			vector <int> cand;
			for (int t: arr){
				int deg = 0;
				for (int j=1;j<=N;j++) if (w[t][j] == 1) deg++;
				for (int j=1;j<=N;j++) if (w[t][j] == 1) P2[j] += P1[t] / deg, cand.pb(j);
			}
			sort(all(cand)); cand.erase(unique(all(cand)), cand.end());
			double mx = 1. / sz(arr);
			for (int j=1;j<=N;j++){
				++K;
				for (int k: cand){
					if (last[w[j][k]] < K || last[w[j][k]] == K && mxp[w[j][k]] < P2[k])
						mxp[w[j][k]] = P2[k];
				}
				double now2 = 0;
				++K;
				for (int k: cand){
					if (last[w[j][k]] == K) continue;
					last[w[j][k]] = K;
					now2 += mxp[w[j][k]];
				}
				mx = max(mx, now2);
			}
			now += mx * sz(arr) / N;
		}
		ans = max(ans, now);
	}
	printf("%.9f\n", ans);
}

#include <stdio.h>
#include <vector>
using namespace std;

int N,M,A[404][404],D[404][404],G[404];
double d[404],r[404]; int chk[404];
vector<int> u[404];

double prop(int l)
{
	for (int i=1;i<=N;i++) r[i] = 0;
	for (int &x : u[l]) for (int i=1;i<=N;i++) if (A[x][i]){
		r[i] += 1. / G[x];
	}

	double mx = 0;
	for (int d=0;d<N;d++) chk[d] = 0;
	for (int y=1;y<=N;y++){
		for (int i=0;i<N;i++) d[i] = 0;
		double sum = 0;
		for (int o=l-1;o<=l+1;o++) if (o >= 0){
			for (auto &i : u[o]){
				double &k = d[D[y][i]];
				if (chk[D[y][i]] != y){
					chk[D[y][i]] = y;
					k = r[i];
					sum += k;
				}
				else{
					if (k < r[i]){
						sum -= k;
						k = r[i];
						sum += k;
					}
				}
			}
		}
		if (mx < sum)
			mx = sum;
	}
	return mx;
}

int main()
{
	scanf ("%d %d",&N,&M);
	for (int i=1;i<=N;i++){
		for (int j=1;j<=N;j++) D[i][j] = 1000;
		D[i][i] = 0;
	}

	for (int x=1;x<N;x++){
		int y = x + 1;
		A[x][y] = A[y][x] = D[x][y] = D[y][x] = 1;
		G[x]++; G[y]++;
	}

	for (int k=1;k<=N;k++) for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) if (D[i][j] > D[i][k] + D[k][j]) D[i][j] = D[i][k] + D[k][j];

	double mx = 0;
	for (int x=1;x<=N;x++){
		for (int y=1;y<=N;y++) u[D[x][y]].push_back(y);
		double sum = 0;
		for (int d=0;d<N;d++){
			double p = prop(d);
			sum += p / N;
		}
		for (int d=0;d<N;d++) u[d].clear();
		if (mx < sum)
			mx = sum;
	}
	printf ("%.12lf\n",mx);

	return 0;
}

// ... why is the output of the sample test case 3 = 11/12 instead of 9/10?...
#ifndef LOCAL
#define NDEBUG
#endif
#include<iomanip>
#include<cassert>
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int n,m;std::cin>>n>>m;

	std::vector<std::vector<int>> d(n,std::vector<int>(n,INT_MAX/2));
	std::vector<std::vector<int>> ad(n);

	for(int z=m;z--;){
		int u,v;std::cin>>u>>v;--u;--v;
		ad[u].push_back(v);
		ad[v].push_back(u);
		d[u][v]=d[v][u]=1;
	}

	for(int i=n;i--;)
		d[i][i]=0;
	for(int k=n;k--;)
	for(int i=n;i--;)
	for(int j=n;j--;)
		d[i][j]=std::min(d[i][j],d[i][k]+d[k][j]);

	std::vector<std::vector<std::vector<int>>> byd(n); // byd[i][dist] = {x: d[i][x] == dist}
	for(int i=n;i--;){
		auto& bydi=byd[i];
		bydi.resize(1+*std::max_element(begin(d[i]),end(d[i])));
		for(int j=n;j--;)
			bydi[d[i][j]].push_back(j);
	}

	std::vector<int> mark;
	std::vector<char> distseen(n);
	std::vector<std::pair<int,int>> markvals; // {val,ind}
	markvals.reserve(n);

	double ans=0;
	for(int x=n;x--;){ // first chosen vertex
		double cur=0;
		for(unsigned dx=0;dx<byd[x].size();++dx){ // reported distance
			int const ci=(int)byd[x][dx].size();
			assert(ci>0);
			double zz=1./ci;

			int sc=0;
			if(ci>1){
				mark.assign(n,0);
				for(int j:byd[x][dx]){
					sc+=(int)ad[j].size();
					for(int k:ad[j]) // surprisingly the time complexity is only O(n^3)
						++mark[k];
				}

				markvals.clear();
				for(int j=n;j--;){
					if(mark[j])
						markvals.push_back({mark[j],j});
					std::sort(begin(markvals),end(markvals),[](auto a,auto b){return a.first>b.first;});
				}

				int maxsmo=0;
				for(int z=n;z--;){
					int smo=0; // sum of max occurence per dist
					for(auto [n_occurence,j]:markvals)
						if(!distseen[d[z][j]]){
							distseen[d[z][j]]=true;
							smo+=n_occurence;
						}

					maxsmo=std::max(maxsmo,smo);

					for(auto [n_occurence,j]:markvals)
						distseen[d[z][j]]=false;
				}

				zz=std::max(zz,maxsmo/(double)sc);
			}

			cur+=zz*ci/n;
		}
		ans=std::max(ans,cur);
	}
	std::cout<<std::setprecision(12)<<std::fixed<<ans<<'\n';
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rev(i, n) for(int i = (n) - 1; i >= 0; --i)
using namespace std;

void bug() { cout << " " << endl; }
template<class T> void bug(T a) { cout << a << "  "; }
template<class T> void bug(T* a, int n) {rep(i, n) bug(a[i]);}

int g[411][411];
int n, m;
vector<int> nodes[411][411]; // nodes[u][i] contains all nodes with dist i if u is the root
vector<int> outs[411][411]; // outs[u][v] if u is the root, and how many outedges from v to -1,0,+1 depth
int dist[411];
int D[411][411];
int vis[411];
double cnt[411];
int mark[411];
int deg[411];
double opt[411];

int main() {
    cin >> n >> m;
    rep(i, m) {
        int u, v;
        cin >> u >> v;
        g[u - 1][v - 1] = g[v - 1][u - 1] = 1;
        deg[u - 1]++;
        deg[v - 1]++;
    }

    rep(i, n) {
        memset(dist, 0, sizeof(dist));
        memset(vis, 0, sizeof(vis));
        queue<int> q;
        q.push(i);
        dist[i] = 0;
        vis[i] = 1;
        while(q.size() > 0) {
            int v = q.front();
            q.pop();
            rep(u, n) if(g[u][v] && !vis[u]){
                vis[u] = 1;
                dist[u] = dist[v] + 1;
                q.push(u);
            }
        }
        rep(u, n) {
            nodes[i][dist[u]].push_back(u);
            D[i][u] = D[u][i] = dist[u];
        }
        rep(u, n) {
            int m1 = 0, z = 0, p1 = 0;
            rep(v, n) if(g[u][v]){
                if(dist[v] == dist[u]) z++;
                else if(dist[v] > dist[u]) p1++;
                else m1++;
            }
            outs[i][u].push_back(m1);
            outs[i][u].push_back(z);
            outs[i][u].push_back(p1);
        }
    }
    double ret = 0;
    rep(u, n) {
        double t = 0;
        rep(k, n + 1) { // k is the distance
            double tt = 0;
            if(nodes[u][k].size() <= 1) {
                for(auto v : nodes[u][k]) {
                    tt += 1.0 / n;
                }
                t += tt;
            }
            else {
                double tt = 0;
                vector<int> vs;
                memset(mark, 0, sizeof(mark));
                memset(cnt, 0, sizeof(cnt));
                for(auto o : nodes[u][k]) {
                    rep(v, n) if(g[o][v]) {
                        mark[v] = 1;
                        cnt[v] += 1.0 / n / deg[o];
                    }
                }
                rep(v, n) if(mark[v]) vs.push_back(v);

                rep(v, n) {
                    for(auto o : vs) opt[D[v][o]] = 0;
                    for(auto o : vs) {
                        opt[D[v][o]] = max(opt[D[v][o]], cnt[o]);
                    }
                    double ttt = 0;
                    for(auto o : vs) {
                        ttt += opt[D[v][o]];
                        opt[D[v][o]] = 0.0;
                    }
                    tt = max(ttt, tt);
                }
                t += tt;
            }
        }
        ret = max(ret, t);
    }
    cout << ret << endl;
    return 0;
}

#include <bits/stdc++.h>
#define fmax(a, b) ((a)>(b)?(a):(b))
#define fmin(a, b) -fmax(-(a), -(b))
using namespace std;

const int MAXN = 500;

int n, m;

vector<int> nxt[MAXN];
int dist[MAXN][MAXN];

int main() {

	scanf("%d %d", &n, &m);
	for(int i = 0; i < m; i++) {
		int a, b;
		scanf("%d %d", &a, &b);
		a--, b--;
		nxt[a].push_back(b);
		nxt[b].push_back(a);
	}

	for(int a = 0; a < n; a++) {
		for(int b = 0; b < n; b++) dist[a][b] = (b == a ? 0 : -1);
		vector<int> q = {a};
		for(int i = 0; i < (int)q.size(); i++) {
			int v = q[i];
			for(int j = 0; j < (int)nxt[v].size(); j++) {
				int w = nxt[v][j];
				if(dist[a][w] == -1) {
					dist[a][w] = dist[a][v] + 1;
					q.push_back(w);
				}
			}
		}
	}

	double very_best_ans = 0;

	for(int a = 0; a < n; a++) {
		double ans = 1.0/n;

		int cnt[n] = {0};
		for(int b = 0; b < n; b++) {
			cnt[dist[a][b]]++;
		}

		for(int d = 1; d < n; d++) {
			if(cnt[d] == 0) continue;
			double p = cnt[d] * 1.0 / n,
				   prob[n] = {0};
			bool suspicious[n] = {0};
			for(int b = 0; b < n; b++) {
				if(dist[a][b] == d) {
					for(int j = 0; j < (int)nxt[b].size(); j++) {
						suspicious[nxt[b][j]] = 1;
						prob[nxt[b][j]] += 1.0 / (cnt[d] * nxt[b].size());
					}
				}
			}

			vector<int> cs;
			for(int b = 0; b < n; b++)
				if(suspicious[b]) cs.push_back(b);

			double best_ans = 0,
				   best_prob[n] = {0};

			for(int b = 0; b < n; b++) {
				double ans_2 = 0;

				for(auto c : cs) {
					best_prob[dist[b][c]] = fmax(best_prob[dist[b][c]], prob[c]);
				}

				for(auto c : cs) {
					ans_2 += best_prob[dist[b][c]];
					best_prob[dist[b][c]] = 0;
				}
				best_ans = fmax(best_ans, ans_2);
			}

			ans += p * best_ans;
		}

		very_best_ans = fmax(very_best_ans, ans);
	}

	printf("%.6lf\n", very_best_ans);

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXSIZE=30000020;
int bufpos;
char buf[MAXSIZE];
#define NEG 0
void init(){
	#ifdef LOCAL
		freopen("D.txt","r",stdin);
	#endif
	buf[fread(buf,1,MAXSIZE,stdin)]='\0';
	bufpos=0;
}
#if NEG
int readint(){
	bool isneg;
	int val=0;
	for(;!isdigit(buf[bufpos]) && buf[bufpos]!='-';bufpos++);
	bufpos+=(isneg=buf[bufpos]=='-');
	for(;isdigit(buf[bufpos]);bufpos++)
		val=val*10+buf[bufpos]-'0';
	return isneg?-val:val;
}
#else
int readint(){
	int val=0;
	for(;!isdigit(buf[bufpos]);bufpos++);
	for(;isdigit(buf[bufpos]);bufpos++)
		val=val*10+buf[bufpos]-'0';
	return val;
}
#endif
char readchar(){
	for(;isspace(buf[bufpos]);bufpos++);
	return buf[bufpos++];
}
int readstr(char* s){
	int cur=0;
	for(;isspace(buf[bufpos]);bufpos++);
	for(;!isspace(buf[bufpos]);bufpos++)
		s[cur++]=buf[bufpos];
	s[cur]='\0';
	return cur;
}
int a[402][402];
bool vis[402];
vector<int> now;
vector<int> e[402];
double cnt[402];
double tmp[202];
int main(){
	init();
	int n=readint(),m=readint();
	memset(a,0x3f,sizeof(a));
	for(int i=1;i<=n;i++)
		a[i][i]=0;
	while(m--){
		int x=readint(),y=readint();
		a[x][y]=a[y][x]=1;
		e[x].push_back(y);
		e[y].push_back(x);
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				a[i][j]=min(a[i][j],a[i][k]+a[k][j]);
	double res=0;
	for(int i=1;i<=n;i++){
		double qwq=0;
		for(int j=0;j<=n;j++){
			for(int k=1;k<=n;k++)
				if (a[i][k]==j){
					for(int o : e[k]){
						if (!tmp[o])
							now.push_back(o);
						tmp[o]+=1.0/(n*e[k].size());
					}
				}
			if (!now.size())
				continue;
			double ans=1.0/n;
			for(int k=1;k<=n;k++){
				double sum=0;
				for(int o : now)
					cnt[a[k][o]]=max(cnt[a[k][o]],tmp[o]);
				for(int o : now)
					sum+=cnt[a[k][o]],cnt[a[k][o]]=0;
				ans=max(ans,sum);
			}
			for(int o : now)
				tmp[o]=0;
			now.clear();
			qwq+=ans;
		}
		res=max(res,qwq);
	}
	printf("%.10f",res);
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<queue>
#include<set>
#include<stack>
#include<map>
#include<vector>
#define fi first
#define se second
#define pb push_back
#define mk make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') f=-1;ch=getchar();}
    x=ch-'0';
    while(1) {ch=getchar();if(ch<'0'||ch>'9') break;x=x*10+ch-'0';}
    return x*f;
}
const int maxn=1010;
int dis[maxn][maxn];
vector<int> w[maxn];
double later[maxn],dist[maxn];
bool vis[maxn];
double check(int n,int g1,int dist1)
{
    double best=0;
    for(int i=1;i<=n;i++) later[i]=0,vis[i]=0;
    vector<int> ipt;
    for(int v=1;v<=n;v++)
        if(dis[g1][v]==dist1)
            for(int b=0;b<(int)w[v].size();b++)
            {
                later[b]+=(double) 1.0/n/w[v].size();
                if(!vis[b]) vis[b]=1,ipt.pb(b);
            }
    for(int g2=1;g2<=n;g2++)
    {
        double tot=0;
        for(int b=0;b<(int)ipt.size();b++)
            dist[dis[g2][b]]=max(dist[dis[g2][b]],later[b]);
        for(int b=0;b<(int)ipt.size();b++)
        {
            tot+=dist[dis[g2][b]];
            dist[dis[g2][b]]=0;
        }
        best=max(best,tot);
    }
    return best;
}
int main()
{

  //  freopen("work.in","r",stdin);
  //  freopen("work.out","w",stdout);
    int n=read(),m=read();
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n&&j!=i;j++)
            dis[i][j]=n+1;
    for(int i=1;i<=m;i++)
    {
        int a=read(),b=read();
        w[a].pb(b);w[b].pb(a);
        dis[a][b]=dis[b][a]=1;
    }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            for(int k=1;k<=n;k++)
                dis[j][k]=min(dis[j][k],dis[j][i]+dis[i][k]);
    double ans=0;
    for(int g1=1;g1<=n;g1++)
    {
        double sum=0;

        for(int dist1=0;dist1<=n;dist1++)
        {
            int cnt=0;
            for(int i=1;i<=n;i++)
                if(dis[g1][i]==dist1) cnt++;
            if(cnt==0) continue;
            double imme=(double) 1.0/n;
            double seco=check(n,g1,dist1);
            sum+=max(imme,seco);
        }
        ans=max(ans,sum);
    }
    printf("%.12lf\n",(double)ans);
//    fclose(stdin);
  //  fclose(stdout);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int INF = 1e9;
const int N = 404;

int n, m;
vector<int> g[N];
int d[N][N];
double prob[N];
double prob_dist[N];
int ptr;
int good[N];
bool vis[N];

double tommorow(int from, int dist) {
  fill(vis, vis + n + 1, 0);
  fill(prob, prob + n + 1, 0);
  fill(prob_dist, prob_dist + n + 1, 0);
  ptr = 0;

  for (int i = 1; i <= n; i++) {
    if (d[from][i] != dist) continue;

    for (int u : g[i]) {
      prob[u] += (1.0D / n) / g[i].size();
      if (!vis[u]) {
        vis[u] = 1;
        good[ptr++] = u;
      }
    }
  }

  double ans = 0;

  for (int v = 1; v <= n; v++) {
    double cur = 0;

    for (int i = 0; i < ptr; i++) {
      int u = good[i];
      prob_dist[d[v][u]] = max(prob_dist[d[v][u]], prob[u]);
    }

    for (int i = 0; i < ptr; i++) {
      int u = good[i];
      cur += prob_dist[d[v][u]];
      prob_dist[d[v][u]] = 0;
    }

    ans = max(ans, cur);
  }

  return ans;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  #endif

  cin >> n >> m;

  for (int i = 1; i <= n; i++) fill(d[i], d[i] + n + 1, INF), d[i][i] = 0;

  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
    d[u][v] = 1;
    d[v][u] = 1;
  }

  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }

  double ans = 0;

  for (int from = 1; from <= n; from++) {
    double cur = 0;

    for (int dist = 0; dist <= n; dist++) {
      int cnt = 0;
      for (int i = 1; i <= n; i++) {
        if (d[from][i] == dist) cnt++;
      }

      if (cnt == 0) continue;

      double now = (1.0D / n) / cnt;
      double after = tommorow(from, dist);

      cur += max(now, after);
    }

    ans = max(ans, cur);
  }

  cout << fixed << setprecision(12) << ans << "\n";
  return 0;
}

#include<bits/stdc++.h>
#define FT first
#define SC second
#define PB push_back
#define MP make_pair
#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 FOR(i, n) for(int i = 0; i < (n); i++)
#define ROF(i, n) for(int i = (n) - 1; i >= 0; i--)
#define VEP(i, x) for(int i = 0; i < x.size(); i++)
#define DFOR(i, x) for(int i = hd[x]; i; i = e[i].nxt)
#define MEM(a, b) memset(a, b, sizeof(a))
#define rint read<int>()
#define rll read<LL>()

using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PI;
const int inf = 0x3fffffff;
const int MOD = 1000000007;

template <typename tn>
inline tn read(){
	char ch; tn f = 1;
	while (!isdigit(ch = getchar())) if (ch == '-') f = -1;
	tn x = ch - '0';
	while (isdigit(ch = getchar())) x = x * 10 + ch - '0';
	return x * f;
}
template <typename tn> inline void cmax(tn &a, tn b){ if (a < b) a = b; }
template <typename tn> inline void cmin(tn &a, tn b){ if (a > b) a = b; }

const int N = 400 + 5;
vector<int> v[N], dot;
int a[N][N], d[N];
double s[N], w[N];
int main(){
	int n = rint, m = rint;
	REP(i, 1, n) REP(j, 1, n) if (i != j) a[i][j] = inf;
	REP(i, 1, m){
		int x = rint, y = rint;
		a[x][y] = a[y][x] = 1, d[x]++, d[y]++;
	}
	REP(k, 1, n) REP(i, 1, n) REP(j, 1, n) cmin(a[i][j], a[i][k] + a[k][j]);
	REP(i, 1, n) REP(j, 1, n) if (a[i][j] > n) cout << "CAO" << endl;
	double ans = 0;
	REP(i, 1, n){
		double now = 0;
		FOR(j, n) v[j].clear();
		REP(j, 1, n) v[a[i][j]].PB(j);
		FOR(dis, n){
			if (v[dis].size() <= 1) { now += (double)v[dis].size() / n; continue; }
			dot.clear(), MEM(w, 0);
			VEP(j, v[dis]) REP(k, 1, n)
				if (a[v[dis][j]][k] == 1){
					if (abs(w[k]) < 1e-10) dot.PB(k);
					w[k] += 1.0 / n / d[v[dis][j]];
				}
			double cur = 0;
			REP(j, 1, n){
				double tmp = 0;
				VEP(k, dot) s[a[j][dot[k]]] = 0;
				VEP(k, dot) cmax(s[a[j][dot[k]]], w[dot[k]]);
				VEP(k, dot) tmp += s[a[j][dot[k]]], s[a[j][dot[k]]] = 0;
				cmax(cur, tmp);
			}
			now += cur;
		}
		cmax(ans, now);
	}
	cout << fixed << setprecision(16) << ans << endl;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll int
#define N 405
#define M 80005
#define eps (1e-6)
#define rep(i,j,k) for (ll i=j;i<=k;++i)
#define per(i,j,k) for (ll i=j;i>=k;--i)
using namespace std;
inline ll read(){
	char ch=getchar(); ll x=0,f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
ll n,m,tot,a[N],f[N][N],head[N],size[N];
double p[N],dis[N],ans=0;
struct edge{ ll to,next; }e[M];
void add(ll u,ll v){
	e[++tot]=(edge){v,head[u]}; head[u]=tot; ++size[u];
}
double calc(ll x,ll d1){
	rep(i,1,n) p[i]=0;
	double ans=0; ll cnt=0;
	rep(i,1,n) if (f[x][i]==d1){
		for (ll j=head[i],v=e[j].to;j;j=e[j].next,v=e[j].to)
			p[v]+=1.0/n/size[i];
	}
	rep(i,1,n) if (p[i]>eps) a[++cnt]=i;
	rep(i,1,n){
		double tmp=0;
		rep(j,1,cnt) dis[f[i][a[j]]]=max(dis[f[i][a[j]]],p[a[j]]);
		rep(j,1,cnt) tmp+=dis[f[i][a[j]]],dis[f[i][a[j]]]=0;
		ans=max(ans,tmp);
	}
	return ans;
}
int main(){
	n=read(); m=read();
	rep(i,1,n) rep(j,1,n) if (i!=j) f[i][j]=n+1;
	rep(i,1,m){
		ll u=read(),v=read();
		add(u,v); add(v,u);
		f[u][v]=f[v][u]=1;
	}
	rep(k,1,n) rep(i,1,n) rep(j,1,n)
		f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
	rep(i,1,n){
		double tmp=0;
		rep(d1,0,n-1){
			ll cnt=0;
			rep(j,1,n) if (f[i][j]==d1) ++cnt;
			if (!cnt) continue;
			double day1=1.0/n;
			double day2=calc(i,d1);
			tmp+=max(day1,day2);
		}
		ans=max(ans,tmp);
	}
	printf("%.12f",ans);
}

#include<bits/stdc++.h>
#define ld double
using namespace std;
const int maxn=400+10;
int lau[maxn][maxn],f[maxn][maxn],cnt[maxn],n,m,vis[maxn],sign;
double ans,pro[maxn],dpro[maxn][maxn],sum[maxn];
vector<int> g[maxn];
vector<int> h[maxn];
void update(int p,int len,ld pr)
{
  if(lau[p][len]!=sign)
  {
	lau[p][len]=sign;
    dpro[p][len]=0;
  }
  if(dpro[p][len]<pr)
  {
	sum[p]+=pr-dpro[p][len];
    dpro[p][len]=pr;
  }
}
double solve(int p)
{
  for(int i=0;i<n;i++)
  {
	cnt[i]=0;
    g[i].clear();
  }
  for(int i=1;i<=n;i++)
  {
	cnt[f[p][i]]++;
    g[f[p][i]].push_back(i);
  }
  ld res=0;
  memset(dpro,0,sizeof(dpro));
  memset(lau,0,sizeof(lau));
  for(int i=0;i<n;i++)
  {
	double v=(ld)cnt[i]/n;ld maxi=0;
    /*if(cnt[i]==1)
    {
      res+=(ld)1/n;
      continue;
    }*/
    memset(vis,0,sizeof(vis));
    memset(pro,0,sizeof(pro));
    memset(sum,0,sizeof(sum));
    sign=i;
    for(int j=0;j<g[i].size();j++)
    {
	  int u=g[i][j],num=h[u].size();
      for(int k=0;k<h[u].size();k++)
      {
	    int hm=h[u][k],dis=f[p][hm];
        if(vis[hm]!=i)
        {
	      vis[hm]=i;
          pro[hm]=0;
        }
        pro[hm]+=(ld)1.0/(ld)(num);
      }
    }
    for(int j=1;j<=n;j++)
      if(vis[j]==i)
        for(int k=1;k<=n;k++)
          update(k,f[j][k],pro[j]);
    for(int i=1;i<=n;i++) maxi=max(maxi,sum[i]);
	res+=maxi/n*1.0;
  }
  //cout<<res<<endl;
  return res;
}
int main()
{
  //freopen("D.in","r",stdin);
  scanf("%d%d",&n,&m);
  memset(f,127/2,sizeof(f));
  for(int i=1;i<=m;i++)
  {
	int x,y;scanf("%d%d",&x,&y);
    f[x][y]=f[y][x]=1;
    h[x].push_back(y);h[y].push_back(x);
  }
  for(int i=1;i<=n;i++) f[i][i]=0;
  for(int k=1;k<=n;k++)
    for(int i=1;i<=n;i++)
      for(int j=1;j<=n;j++)
        if(i!=k&&k!=j&&i!=j)
          f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
  for(int i=1;i<=n;i++) ans=max(ans,solve(i));
  printf("%.9lf\n",ans);
  return 0;
}

#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#define MN 400
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
double P[MN+5][MN+5],ans=0,mx[MN+5][MN+5],Mx[MN+5],MMx[MN+5];vector<int> v[MN+5];
int n,m,d[MN+5][MN+5],head[MN+5],cnt=0,du[MN+5];
struct edge{int to,next;}e[MN*MN+5];
inline void ins(int f,int t){e[++cnt]=(edge){t,head[f]};head[f]=cnt;}
int main()
{
	n=read();m=read();
	memset(d,63,sizeof(d));
	for(int i=1;i<=n;++i) d[i][i]=0;
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read();
		ins(x,y);ins(y,x);++du[x];++du[y];d[x][y]=d[y][x]=1;
	}
	for(int k=1;k<=n;++k)for(int i=1;i<=n;++i)for(int j=1;j<=n;++j)
		if(d[i][k]+d[k][j]<d[i][j]) d[i][j]=d[i][k]+d[k][j];
	for(int i=1;i<=n;++i)
	{
		double res=0;
		for(int j=0;j<n;++j) v[j].clear(),MMx[j]=0;
		for(int j=1;j<=n;++j) v[d[i][j]].push_back(j);
		for(int j=0;j<n;++j)for(int k=1;k<=n;++k) P[j][k]=0;
		for(int D=0;D<n;++D) if(v[D].size())
		{
			for(int j=0;j<v[D].size();++j)
			{
				int t=v[D][j];
				for(int l=head[t];l;l=e[l].next)
					P[D][e[l].to]+=1./n/du[t];
				//	cout<<i<<" dep= "<<D<<" "<<t<<" -> "<<e[l].to<<" += "<<1./n/du[t]<<endl;
			}
		}
		for(int j=1;j<=n;++j)
		{
			double tot=0;
			for(int k=1;k<=n;++k)
				for(int ad=-1;ad<=1;++ad)
					if(d[i][k]+ad>=0)
					{
					//	cout<<i<<" used "<<j<<" pos = "<<k<<" ad= "<<ad<<" "<<d[i][k]+ad<<" "<<P[d[i][k]+ad][k]<<endl;
						 Mx[d[i][k]+ad]-=mx[d[i][k]+ad][d[j][k]];
						 mx[d[i][k]+ad][d[j][k]]=max(P[d[i][k]+ad][k],mx[d[i][k]+ad][d[j][k]]);
						 Mx[d[i][k]+ad]+=mx[d[i][k]+ad][d[j][k]];
					//	 cout<<"after Mx["<<d[i][k]+ad<<"] = "<<Mx[d[i][k]+ad]<<endl;
					}
			for(int k=0;k<n;++k) MMx[k]=max(MMx[k],Mx[k]),Mx[k]=0;
			for(int k=1;k<=n;++k)
				for(int ad=-1;ad<=1;++ad)
					if(d[i][k]+ad>=0) mx[d[i][j]+ad][d[j][k]]=0;
		}
		for(int j=0;j<n;++j) if(v[j].size()) res+=max(1./n,MMx[j]);
		ans=max(ans,res);
	}
	printf("%.10lf",ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int MAX = 500;

vector<int> edge[MAX];
int G[MAX][MAX];
int cnt_nxt[MAX];
double p_nxt[MAX], p_dist[MAX];
bool vis[MAX];

int n, m;

double solve(int g1, int dist1) {
    double rst = 0;
    for (int i = 1; i <= n; i++) {
        p_nxt[i] = 0;
        vis[i] = false;
    }
    vector<int> city;
    for (int v = 1; v <= n; v++) {
        if (G[g1][v] != dist1) continue;
        for (auto b : edge[v]) {
            p_nxt[b] += 1.0 / n / edge[v].size();
            if (!vis[b]) vis[b] = true, city.push_back(b);
        }
    }
    for (int g2 = 1; g2 <= n; g2++) {
        double tmp = 0;
        for (auto b : city) {
            p_dist[G[g2][b]] = max(p_dist[G[g2][b]], p_nxt[b]);
            p_nxt[b] = 0;
            vis[b] = false;
        }
        for (auto b : city) {
            tmp += p_dist[G[g2][b]];
            p_dist[G[g2][b]] = 0;
        }
        rst = max(rst, tmp);
    }
    return rst;
}

int main() {
    scanf("%d %d", &n, &m);

    memset(G, 0x3f, sizeof(G));
    for (int i = 1; i <= n; i++) G[i][i] = 0;

    for (int i = 1; i <= m; i++) {
        int u, v;
        scanf("%d %d", &u, &v);
        edge[u].push_back(v);
        edge[v].push_back(u);
        G[u][v] = G[v][u] = 1;
    }

    for (int b = 1; b <= n; b++) {
        for (int a = 1; a <= n; a++) {
            for (int c = 1; c <= n; c++) {
                G[a][c] = min(G[a][c], G[a][b] + G[b][c]);
            }
        }
    }

    double ans = 0;
    for (int g1 = 1; g1 <= n; g1++) {
        double tans = 0;
        for (int dist1 = 0; dist1 <= n; dist1++) {
            int cnt_city = 0;
            for (int i = 1; i <= n; i++) if (G[g1][i] == dist1) cnt_city++;
            if (!cnt_city) continue;
            tans += max(1.0 / n, solve(g1, dist1));
        }
        ans = max(tans, ans);
    }

    printf("%.12f\n", ans);
}

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 205
int map[N][N],n,m,in1[N];
vector<int>v[N];
double ans,tmp_ans,b[N],tt,a[N];
int main()
{
	// freopen("leidilu.in","r",stdin);
	// freopen("leidilu.out","w",stdout);
	scanf("%d%d",&n,&m);memset(map,0x3f,sizeof(map));tt=1.0/n;
	for(int i=1;i<=n;i++)map[i][i]=0;
	for(int i=1;i<=m;i++)
	{
		int x,y;scanf("%d%d",&x,&y);
		map[y][x]=map[x][y]=1;in1[x]++,in1[y]++;
	}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				map[i][j]=min(map[i][k]+map[k][j],map[i][j]);
	for(int i=1;i<=n;i++)
	{
		for(int t=1;t<=n;t++)
		{
			for(int j=0;j<=n;j++)v[j].clear();
			for(int j=1;j<=n;j++)v[map[i][j]].push_back(j);
			tmp_ans=0;
			for(int j=0;j<=n;j++)
			{
				if(v[j].empty())continue;
				memset(a,0,sizeof(a));memset(b,0,sizeof(b));
				double tmp=(v[j].size()*1.0)/n;
				if((int)v[j].size()==1){tmp_ans+=tmp;continue;}
				for(int k=0;k<v[j].size();k++)
					for(int l=1;l<=n;l++)if(map[v[j][k]][l]==1)
						b[l]+=tt/in1[v[j][k]];
				for(int k=1;k<=n;k++)
					a[map[t][k]]=max(a[map[t][k]],b[k]);
				double uu=0;for(int k=0;k<=n;k++)uu+=a[k];tmp_ans+=max(uu,tt);
			}ans=max(ans,tmp_ans);
		}
	}
	printf("%.7lf\n",ans);
}

#include<bits/stdc++.h>
using namespace std;
int dis[505][505],q[505];
double b[505],c[505];
int n,m,x,y;
double ans;
int main(){
	scanf("%d%d",&n,&m);
	memset(dis,1,sizeof(dis));
	for (int i=1;i<=n;i++) dis[i][i]=0;
	for (int i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		dis[x][y]=dis[y][x]=1;
	}
	for (int k=1;k<=n;k++)
		for (int i=1;i<=n;i++)
			for (int j=1;j<=n;j++)
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
	for (int i=1;i<=n;i++){
		double r=0;
		for (int j=0;j<n;j++){
			int u=0,p=0; double t=0;
			memset(b,0,sizeof(b));
			for (int k=1;k<=n;k++)
				if (dis[i][k]==j){
					int v=0; u++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) v++;
					for (int l=1;l<=n;l++)
						if (dis[k][l]==1) b[l]+=1.0/v;
				}
			for (int k=1;k<=n;k++)
				if (abs(dis[i][k]-j)<=1)
					q[++p]=k;
			for (int k=1;k<=n;k++){
				double w=0;
				for (int l=1;l<=p;l++)
					if (b[q[l]]>c[dis[k][q[l]]])
						c[dis[k][q[l]]]=b[q[l]];
				for (int l=1;l<=p;l++)
					w+=c[dis[k][q[l]]],c[dis[k][q[l]]]=0;
				t=max(t,w);
			}
			if (t>1) puts("!!!");
			if (u) t=max(t,1.0);
			r+=t/n;

		}
		ans=max(ans,r);
	}
	printf("%.12lf\n",ans);
}

#include <cassert>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int n, d[512][512];
int deg[512];
vector<int> neigh[512];

void initialize(std::istream &in) {
	int m;
	in >> n >> m;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			d[i][j] = (i == j ? 0 : 1e9);
	for (int i = 0; i < n; i++) {
		deg[i] = 0;
		neigh[i].clear();
	}
	for (int i = 0; i < m; i++) {
		int a, b;
		in >> a >> b;
		a--; b--;
		d[a][b] = d[b][a] = 1;
		deg[a]++; deg[b]++;
		neigh[a].push_back(b);
		neigh[b].push_back(a);
	}
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			for (int k = 0; k < n; k++)
				d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

vector<int> vlist[512];
double prob[512] = {0.0};
double mval[512] = {0.0};

void solve_case(std::ostream &out) {
	double res = 0.0;
	for (int r = 0; r < n; r++) {
		for (int i = 0; i < 512; i++)
			vlist[i].clear();

		int max_d = 0;
		for (int v = 0; v < n; v++) {
			vlist[d[r][v]].push_back(v);
			max_d = max(max_d, d[r][v]);
		}

		double nres = 0.0;
		for (int dval = 0; dval <= max_d; dval++) {
			vector<int> &cur_vlist = vlist[dval];
			int sz = (int)cur_vlist.size();

			// use prob array
			// mistake: / (double)sz factor
			for (int v : cur_vlist)
				for (int w : neigh[v])
					prob[w] += 1.0 / (double)deg[v] / (double)sz;

			cerr << "r " << r << " dval " << dval << endl;
			for (int i = 0; i < n; i++)
				cerr << prob[i] << " ";
			cerr << endl;

			double ans = 1.0 / (double)sz;
			for (int s = 0; s < n; s++) {
				// use mval array
				double mval_sum = 0.0;
				for (int v : cur_vlist)
					for (int w : neigh[v])
						if (mval[d[s][w]] < prob[w]) {
							mval_sum -= mval[d[s][w]];
							mval[d[s][w]] = prob[w];
							mval_sum += prob[w];
						}

				// cleanup mval array
				for (int v : cur_vlist)
					for (int w : neigh[v])
						mval[w] = 0.0;

				ans = max(ans, mval_sum);
			}

			// cleanup prob array
			for (int v : cur_vlist)
				for (int w : neigh[v])
					prob[w] = 0.0;

			nres += (double)sz / (double)n * ans;
		}
		res = max(res, nres);
	}

	out << res << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    istream& in = cin;
    ostream& out = cout;

	out << std::setprecision(20);
	initialize(in);
	solve_case(out);
    return 0;
}