#include <bits/stdc++.h>
using namespace std;
unsigned long long adj[40];
long long mx = 0;
long long f[1 << 20];
long long N;
void findClique(long long u, unsigned long long n, unsigned long long s,
                long long l, long long r, bool sf) {
  if (u == r) return;
  findClique(u + 1, n, s, l, r, sf);
  if (((1ULL << u) & n) == 0) {
    if (((1ULL << u) & s) && ((adj[u] & n) == n)) {
      auto mask = n | (1ULL << u);
      if (sf) {
        f[mask] = __builtin_popcountll(mask);
      } else {
        mx = max(mx, f[(adj[u] & s) << (64 - (N >> 1)) >> (64 - (N >> 1))] +
                         __builtin_popcountll(mask));
      }
      findClique(u + 1, mask, s & adj[u], l, r, sf);
    }
  }
}
signed main() {
  long long k;
  cin >> N >> k;
  for (long long i = 0; i < N; i++)
    for (long long j = 0; j < N; j++) {
      long long x;
      cin >> x;
      if (x) {
        adj[i] |= (1ULL << j);
      }
    }
  findClique(0, 0, -1, 0, N >> 1, 1);
  for (long long mask = 0; mask < (1 << (N >> 1)); mask++)
    if (f[mask] == 0) {
      for (long long j = 0; j < (N >> 1); j++)
        if ((1ULL << j) & mask) {
          f[mask] = max(f[mask], f[mask & ~(1ULL << j)]);
        }
    }
  mx = f[(1 << (N >> 1)) - 1];
  findClique(N >> 1, 0, -1, N >> 1, N, 0);
  if (mx == 0) {
    cout << 0;
    return 0;
  }
  double res = (double)(k) * (double)(k) * (double)(mx - 1) / (double)(2 * mx);
  cout << fixed << setprecision(9) << res;
}
