#include <bits/stdc++.h>
using namespace std;
const int N = 45;
int n, k, g[N][N];
namespace S {
int T, i, j, k, a[N], del[N], ans, fin[N];
void solve() {
  for (i = 0; i < n; ++i) del[i] = 0;
  for (k = i = 0; i < n; ++i)
    if (!del[i])
      for (++k, j = i + 1; j < n; ++j)
        if (!g[a[i]][a[j]]) del[j] = 1;
  if (k > ans)
    for (ans = k, i = j = 0; i < n; ++i)
      if (!del[i]) fin[j++] = a[i];
};
void main() {
  for (i = 0; i < n; ++i) a[i] = i;
  for (T = 9999; T--; solve())
    for (i = 0; i < n; ++i) swap(a[i], a[i + rand() % (n - i)]);
}
}  // namespace S
int main() {
  srand(19260817);
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) scanf("%d", &g[i][j]);
  S::main();
  int m = S::ans;
  double v = (double)k / m;
  printf("%.8f\n", m * (m - 1) / 2 * (v * v));
  return 0;
}
