#include <bits/stdc++.h>
using namespace std;
const int N = 20;
long long adj[2 * N], dp[1 << N], n;
map<long long, int> mp;
int solve(long long msk) {
  if (msk < 1 << (n / 2)) return dp[msk];
  if (mp[msk]) return mp[msk];
  int v = 63 - __builtin_clzll(msk);
  return mp[msk] = max(solve(msk ^ (1LL << v)), 1 + solve(msk & adj[v]));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int k, b;
  cin >> n >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> b, adj[i] |= (b ? 1LL << j : 0);
  for (int msk = 1; msk < 1 << (n / 2); msk++) {
    int v = __builtin_ctz(msk);
    dp[msk] = max(dp[msk ^ (1 << v)], 1 + dp[msk & adj[v]]);
  }
  int t = solve((1LL << n) - 1);
  double ans = k / (t + 0.0) * k / (t + 0.0) * t * (t - 1) / 2.0;
  cout << fixed << setprecision(12) << ans;
  return 0;
}
