#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 21;
const int M = 1e9 + 7;
const int inf = 1e9 + 7;
const long long INF = 1e18;
int n, k;
long long a[50];
int dp[N];
int p2[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int z = 1;
  for (int i = 0; i < 20; i++) {
    p2[z] = i;
    z <<= 1;
  }
  cin >> n >> k;
  int x;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      cin >> x;
      a[i] |= (x || i == j) * (1LL << j);
    }
  int _n = max(n - 20, 0);
  for (int s = 1; s < (1 << _n); s++) {
    int cur = s, sz = 0;
    while (cur) {
      int lb = cur & -cur;
      int idx = p2[lb];
      if ((s & (a[idx + 20] >> 20)) != s) {
        break;
      }
      cur ^= lb;
      sz++;
    }
    if (!cur) {
      dp[s] = sz;
    }
  }
  for (int s = 1; s < (1 << _n); s++) {
    int cur = s;
    while (cur) {
      int lb = cur & -cur;
      dp[s] = max(dp[s], dp[s ^ lb]);
      cur ^= lb;
    }
  }
  int fs = 1 << _n;
  fs--;
  _n = min(n, 20);
  int ans = 0;
  for (int s = 0; s < (1 << _n); s++) {
    int cur = s, sz = 0, _s = fs;
    while (cur) {
      int lb = cur & -cur;
      int idx = p2[lb];
      if ((s & a[idx]) != s) {
        break;
      }
      cur ^= lb;
      _s &= a[idx] >> 20;
      sz++;
    }
    if (cur) continue;
    ans = max(ans, sz + dp[_s]);
  }
  long double _x = (long double)k / ans;
  cout << fixed << setprecision(8) << _x * _x * ans * (ans - 1) / 2 << '\n';
}
