#include <bits/stdc++.h>
inline int read() {
  int x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x;
}
int n, k, g[41][41];
int cnt[41], ans, ch[41];
bool dfs(int u, int now) {
  ch[now] = u;
  if (now > ans) return ans = now, 1;
  for (int v = u + 1; v <= n; ++v) {
    if (!g[u][v] || now + cnt[v] + 1 <= ans) continue;
    int pos = 1;
    for (int i = 1; i <= now; ++i, pos = i)
      if (!g[v][ch[i]]) break;
    if (pos > now && dfs(v, now + 1)) return 1;
  }
  return 0;
}
int main() {
  n = read(), k = read();
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; g[i][j] = read(), ++j)
      ;
  for (int i = n; i >= 1; dfs(i, 1), cnt[i] = ans, --i)
    ;
  double A = 1.0 * k / ans, B = ans * (ans - 1) / 2;
  printf("%.10lf\n", A * A * B);
  return 0;
}
