#include <bits/stdc++.h>
double m;
int n, i, j, ans, a[41][41], c[41], cnt[41];
int dfs(int x, int y) {
  c[y] = x;
  if (y > ans) return ans = y, 1;
  for (int i = 0, z = x + 1; z <= n; z++) {
    if (!a[x][z] || y + cnt[z] <= ans) continue;
    for (i = 1; i <= y; i++)
      if (!a[c[i]][z]) break;
    if (i > y && dfs(z, y + 1)) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%lf", &n, &m);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) scanf("%d", &a[i][j]);
  for (i = n; i >= 1; i--) dfs(i, 1), cnt[i] = ans;
  printf("%.6lf\n", m * m / ans * (ans - 1) / 2);
}
