#include <bits/stdc++.h>
using namespace std;
const int N = 45;
int n, K, x, i, j, ans;
bool flag;
unsigned long long g[N];
double res;
inline int ctz(unsigned long long s) { return s ? __builtin_ctzll(s) : 64; }
void BornKerbosch(unsigned long long cur, unsigned long long allow,
                  unsigned long long forbid) {
  if (!allow && !forbid) {
    ans = max(ans, __builtin_popcountll(cur));
    return;
  }
  if (!allow) return;
  int pivot = ctz(allow | forbid);
  unsigned long long z = allow & ~g[pivot];
  for (int u = ctz(z); u < n; u += ctz(z >> (u + 1)) + 1) {
    BornKerbosch(cur | (1ULL << u), allow & g[u], forbid & g[u]);
    allow ^= 1ULL << u, forbid |= 1ULL << u;
  }
}
int main() {
  scanf("%d%d", &n, &K);
  for (i = 0; i < n; i++) g[i] = (1ULL << n) - 1 - (1ULL << i);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      scanf("%d", &x);
      if (!x && i != j) g[i] ^= 1ULL << j;
    }
  BornKerbosch(0, (1ULL << n) - 1, 0);
  if (ans > 1) res = 1.0 * (ans - 1) / 2.0 / ans;
  printf("%.10f", res * K * K);
}
