#include <bits/stdc++.h>
using namespace std;
int n, m;
int dmap[45][45];
int ans[45];
int dans[45];
int nans, zans;
void dfs(int dn) {
  if (dn == n + 1) {
    if (nans > zans) {
      zans = nans;
    }
    return;
  }
  int mark = 0;
  for (int i = 1; i < dn; i++)
    if (ans[i] == 1 && dmap[i][dn] == 0) mark = 1;
  if (mark == 0) {
    ans[dn] = 1;
    nans++;
    dfs(dn + 1);
    nans--;
  }
  if (nans + n - dn > zans) {
    ans[dn] = 0;
    dfs(dn + 1);
  }
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%d", &dmap[i][j]);
  nans = 0;
  zans = 0;
  dfs(1);
  double zzans = zans;
  printf("%lf\n", (zzans - 1) / zzans / 2 * m * m);
  return 0;
}
