#include <bits/stdc++.h>
using namespace std;
int n, k, C = 20, dp[1 << 21];
long long adj[50];
int count(int b) {
  int ret(0);
  while (b) {
    if (b & 1) ret++;
    b >>= 1;
  }
  return ret;
}
int find() {
  int x;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      scanf("%d", &x);
      if (x || i == j) adj[i] |= 1ll << j;
    }
  int ret = 0;
  int rlimit = 1 << (max(0, n - C));
  for (int i = 1; i < rlimit; i++) {
    int x = i;
    for (int j = 0; j < C; j++)
      if ((i >> j) & 1) x &= adj[j + C] >> C;
    if (x == i) dp[i] = count(i);
  }
  for (int i = 1; i < rlimit; i++)
    for (int j = 0; j < C; j++)
      if ((i >> j) & 1) dp[i] = max(dp[i], dp[i ^ (1 << j)]);
  int limit = 1 << min(n, C);
  for (int i = 0; i < limit; i++) {
    int x = i, y = rlimit - 1;
    for (int j = 0; j < C; j++)
      if ((i >> j) & 1) {
        x &= (adj[j] & ((1 << C) - 1));
        y &= (adj[j] >> C);
      }
    if (x != i) continue;
    ret = max(ret, count(i) + dp[y]);
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &k);
  int m = find();
  double ans = 1.0 * k * k * (m - 1) / (2 * m);
  printf("%.10lf", ans);
}
