#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
template <typename X, typename Y> istream& operator>>(istream& is, pair<X, Y>& p) { return is >> p.first >> p.second; }
const int N = 50;
int n;
ll a[N], repr[N], mem[N][2];
ll C(int i, bool borrow) {
    ll& ans = mem[i][borrow];
    if(ans == -1) {
        if(i == n - 1) {
            ans = 1;
        } else if(borrow + repr[i] == 0 or borrow + repr[i] == a[i + 1] / a[i]) {
            ans = C(i + 1, borrow);
        } else {
            ans = C(i + 1, false) + C(i + 1, true);
        }
    }
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll x;
    cin >> n >> x >> a[0];
    for(int i = 1; i < n; i++) {
        cin >> a[i];
        repr[i - 1] = (x % a[i]) / a[i - 1];
        x -= x % a[i];
    }
    memset(mem, -1, sizeof mem);
    cout << C(0, false) << endl;
    return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,b,a) for(int i=b;i>=a;i--)
#define efo(i,u,v) for(int i=BB[u],v=B[BB[u]][1];i;v=B[i=B[i][0]][1])
#define mset(a,x) memset(a,x,sizeof(a))
template<typename T> bool chkmin(T &a,const T &b) {return b<a?a=b,1:0;}
template<typename T> bool chkmax(T &a,const T &b) {return b>a?a=b,1:0;}
using namespace std;
typedef long long ll;
typedef double db;
char ch;
int read(){int n=0,p=1;for(ch=getchar();ch<'0' || '9'<ch;ch=getchar())if(ch=='-') p=-1;for(;'0'<=ch && ch<='9';ch=getchar()) n=n*10+ch-'0';return n*p;}
const int N=105;
int n,a[N][N],fa[N],sz[N];
int getfa(int x)
{
	if(!fa[x]) return x;
	fa[x]=getfa(fa[x]);
	return fa[x];
}
bool vis[N],insta[N];
int sta[N],cnt[N];
void mrg(int x,int y)
{
	int fx=getfa(x),fy=getfa(y);
	if(fx==fy) return;
	fa[fy]=fx;
	sz[fx]+=sz[fy],sz[fy]=0;
}
void dfs(int x)
{
	if(vis[x])
	{
		if(insta[x])
		for(int i=sta[0];sta[i]!=x;i--)
			mrg(sta[i],x);
		return;
	}
	sta[++sta[0]]=x,insta[x]=1;
	vis[x]=1;
	fo(y,1,n)
		if(a[x][y]) dfs(y);
	sta[sta[0]--]=0,insta[x]=0;
}
void dfs1(int x)
{
	vis[x]=1,++cnt[x];
	fo(y,1,n) if(a[x][y] && !vis[y])
	{
		dfs1(y);
	}
}
int main()
{
	//freopen("!.in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%d\n",&n);
	fo(i,1,n)
	{
		fo(j,1,n) a[i][j]=getchar()-'0';
		scanf("\n");
		sz[i]=1;
	}
	fo(i,1,n)
	{
		mset(vis,0);
		dfs(i);
	}
	fo(i,1,n)
	{
		mset(vis,0);
		dfs1(i);
	}
	db ans=0;
	fo(i,1,n)
		if(getfa(i)==i) ans+=sz[i]*1.0/cnt[i];
	printf("%.12lf\n",ans);
	return 0;
}
