#include <bits/stdc++.h>
using namespace std;
const int MAX = 43, C = 20;
int n, k, dp[1 << C];
long long adj[MAX];
int maxClique() {
  for (int i = 1; i < (1 << max(0, n - C)); i++) {
    int x = i;
    for (int j = 0; j < max(0, n - C); j++)
      if ((i >> j) & 1) x &= adj[j + C] >> C;
    if (x == i) dp[i] = __builtin_popcount(i);
  }
  for (int i = 1; i < (1 << max(0, n - C)); i++)
    for (int j = 0; j < max(0, n - C); j++)
      if ((i >> j) & 1) dp[i] = max(dp[i], dp[i ^ (1 << j)]);
  int ans = 0;
  for (int i = 0; i < (1 << min(C, n)); i++) {
    int x = i, y = (1 << max(0, n - C)) - 1;
    for (int j = 0; j < min(C, n); j++)
      if ((i >> j) & 1) x &= adj[j], y &= adj[j] >> C;
    if (x == i) ans = max(ans, __builtin_popcount(i) + dp[y]);
  }
  return ans;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0, x; j < n; j++)
      cin >> x, adj[i] |= (long long)(x || i == j) << j;
  int ans = maxClique();
  double x = (double)k / (double)ans;
  printf("%.9lf\n", x * x * ans * (ans - 1) / 2.0);
  return 0;
}
