#include <bits/stdc++.h>
using namespace std;
const long long maxn = 50;
bool matrix[maxn][maxn];
long long gl[maxn];
int pereb(long long &p, long long &np, vector<long long> &ans, long long r,
          long long n) {
  int k = (int)ans.size();
  for (long long i = r; i >= 0; i--) {
    if (((p >> i) & 1LL) == 0) continue;
    for (long long j = 0; j < n; j++)
      if (((np >> j) & 1) != 0)
        if ((gl[j] & p) == p) return k;
    ans.push_back(i);
    p = (p ^ (1LL << i));
    long long newp = (gl[i] & p);
    long long newnp = (gl[i] & np);
    if (newp)
      k = max(pereb(newp, newnp, ans, i - 1, n), k);
    else
      k = max(k, (int)ans.size());
    np = (np | (1LL << i));
    ans.pop_back();
  }
  return k;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.setf(ios::fixed);
  cout.precision(10);
  long long n;
  double k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) {
      int a;
      cin >> a;
      if (a) gl[i] = (gl[i] | (1LL << j));
    }
  long long p = 0, np = 0;
  vector<long long> ans;
  for (long long i = 0; i < n; i++) p = (p | (1 << i));
  int r = pereb(p, np, ans, n - 1, n);
  double y = (k / r) * (k / r);
  y *= (r * (r - 1) / 2);
  cout << y;
}
