#include <bits/stdc++.h>
using namespace std;
int n, k;
const int C = 20, N = 40;
long long g[N];
int dp[1 << C];
int maxc() {
  for (int mask = 1; mask < (1 << max(0, n - C)); mask++) {
    int cmask = mask;
    for (int j = 0; j < n - C; j++) {
      if (mask & (1 << j)) {
        cmask = cmask & (g[j + C] >> C);
      }
    }
    if (mask == cmask) {
      dp[mask] = __builtin_popcount(mask);
    }
  }
  for (int mask = 1; mask < (1 << max(0, n - C)); mask++) {
    for (int i = 0; i < C; i++) {
      if (mask & (1 << i)) {
        dp[mask] = max(dp[mask], dp[mask ^ (1 << i)]);
      }
    }
  }
  int ans = 0;
  for (int mask = 0; mask < (1 << min(C, n)); mask++) {
    int cmask = mask;
    int smask = (1 << max(0, n - C)) - 1;
    for (int i = 0; i < min(C, n); i++) {
      if (cmask & (1 << i)) {
        cmask = cmask & (g[i] & ((1 << C) - 1));
        smask = smask & (g[i] >> C);
      }
    }
    if (cmask == mask) {
      ans = max(ans, __builtin_popcount(mask) + dp[smask]);
    }
  }
  return ans;
}
signed main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      long long x;
      cin >> x;
      if (i == j) x = 1;
      g[i] = g[i] | (x << j);
    }
  }
  int ans = maxc();
  long double K = (long double)k;
  long double m = (long double)ans;
  long double fans = (K * K * (m - 1)) / (2 * m);
  cout << fixed;
  cout << setprecision(20);
  cout << fans << endl;
}
