#include <bits/stdc++.h>
using namespace std;
vector<int> randperm(int N) {
  vector<int> V, ans;
  for (int i = 0; i < N; i++) V.push_back(i);
  for (int size = N; size > 0; size--) {
    int sample = V[rand() % size];
    ans.push_back(sample);
    vector<int> U;
    for (int v : V)
      if (v != sample) U.push_back(v);
    V = U;
  }
  return ans;
}
int indep(vector<vector<int>>& V) {
  int N = V.size();
  vector<int> U = randperm(N);
  set<int> ind;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    bool good = true;
    for (int v : V[U[i]]) {
      if (ind.count(v) > 0) {
        good = false;
        break;
      }
    }
    if (good) {
      ans++;
      ind.insert(U[i]);
    }
  }
  return ans;
}
int main() {
  int N, K;
  cin >> N >> K;
  vector<vector<int>> G(N);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      int edge;
      cin >> edge;
      if (edge == 0) G[i].push_back(j);
    }
  }
  int curmax = 0;
  for (int t = 0; t < 50000; t++) {
    curmax = max(curmax, indep(G));
  }
  double ans = K * K * (0.5 - 0.5 / curmax);
  printf("%.7f\n", ans);
  return 0;
}
