#include <bits/stdc++.h>
const int maxN = 50;
bool G[maxN][maxN];
int list[maxN][maxN];
int mc[maxN];
int len[maxN];
int n, k;
int ans, found;
void dfs(int size) {
  if (len[size] == 0) {
    if (size > ans) ans = size, found = true;
    return;
  }
  for (int k = 0, i, j; k < len[size] && !found; ++k) {
    if (size + len[size] - k <= ans) break;
    i = list[size][k];
    if (size + mc[i] <= ans) break;
    for (j = k + 1, len[size + 1] = 0; j < len[size]; ++j)
      if (G[i][list[size][j]]) list[size + 1][len[size + 1]++] = list[size][j];
    dfs(size + 1);
  }
}
void work() {
  mc[n] = ans = 1;
  for (int i = n - 1; i; i--) {
    found = false;
    len[1] = 0;
    for (int j = i + 1; j <= n; j++)
      if (G[i][j]) list[1][len[1]++] = j;
    dfs(1);
    mc[i] = ans;
  }
}
int main() {
  std::cin >> n >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) std::cin >> G[i][j];
  work();
  int m = mc[1];
  if (m == 0) {
    puts("0");
    exit(0);
  }
  double ans = 0;
  for (int i = 1; i <= m; i++)
    ans = std::max(ans, pow(1.0 * k / i, 2) * (i - 1) * i / 2);
  printf("%.8lf\n", ans);
  return 0;
}
