#include <bits/stdc++.h>
using namespace std;
const int MN = 44, MS = (1 << 21) + 2;
int n, K;
long long adj[MN];
int dp[MS], clique;
bool is[MS];
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> K;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      bool t;
      cin >> t;
      adj[i] |= (1ll << j) * t;
    }
  if (n == 1) return cout << "0\n", 0;
  int b = n / 2;
  for (int msk = 1; msk < (1 << b); ++msk) {
    int v = __builtin_ctz(msk);
    dp[msk] = dp[msk ^ (1 << v)];
    dp[msk] = max(dp[msk], dp[(msk ^ (1 << v)) & adj[v]] + 1);
    clique = max(clique, dp[msk]);
  }
  is[0] = true;
  for (int msk = 1; msk < (1 << (n - b)); ++msk) {
    int v = __builtin_ctz(msk);
    is[msk] = is[msk ^ (1 << v)];
    v += b;
    for (int i = b; i < n; ++i)
      if (i != v) {
        if ((msk & (1 << (i - b))) && !(adj[v] & (1ll << i))) is[msk] = false;
      }
    if (is[msk]) {
      long long M = (1 << b) - 1;
      for (int i = b; i < n; ++i)
        if (msk & 1 << (i - b)) M &= adj[i];
      clique = max(clique, dp[M] + __builtin_popcount(msk));
    }
  }
  cout << setprecision(12) << fixed
       << 1ll * clique * (clique - 1) * ((long double)K / clique) *
              ((long double)K / clique) / 2
       << '\n';
  return 0;
}
