#include <bits/stdc++.h>
using namespace std;
int n, k, i, j, x, lg[1 << 20], f1[1 << 20], f2[1 << 20], ans, n1, n2, a;
long long e[42];
bool g[1 << 20];
int main() {
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      scanf("%d", &x);
      if (x) e[i] |= 1ll << j;
    }
  n1 = n / 2, n2 = n - n1;
  for (i = 0; i < n2; i++) lg[1 << i] = i;
  for (i = 1; i < 1 << n1; i++) {
    a = lg[i & -i];
    f1[i] = max(f1[i ^ (1 << a)], f1[i & e[a]] + 1);
  }
  ans = f1[(1 << n1) - 1];
  g[0] = 1, f2[0] = (1 << n1) - 1;
  for (i = 1; i < 1 << n2; i++) {
    a = lg[i & -i];
    f2[i] = f2[i ^ (1 << a)] & e[a + n1];
    if (g[i ^ (1 << a)] && (e[a + n1] >> n1 & i) == (i ^ (1 << a)))
      g[i] = 1, ans = max(ans, f1[f2[i]] + __builtin_popcount(i));
  }
  printf("%.8lf", 0.5 * k * k * (ans - 1) / ans);
}
