#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAX = 100;
vector<int> g[MAX];
int vis[MAX];
int solve(map<int, int>& m) {
  int ans = 0;
  for (auto i : m) vis[i.first] = 0;
  for (auto [i, __] : m)
    if (!vis[i]) {
      map<int, int> comp;
      function<void(int)> dfs = [&](int k) {
        comp[k] = m[k], vis[k] = 1;
        for (int j : g[k])
          if (!vis[j] and m.count(j)) dfs(j);
      };
      dfs(i);
      auto menos = [&](int x) {
        auto it = comp.find(x);
        if (it != comp.end()) it->second--;
      };
      int ma, deg = -1, path = 0;
      for (auto [v, d] : comp) {
        path += d;
        if (d > deg) deg = d, ma = v;
      }
      if (deg <= 2) {
        if (path == 2 * comp.size())
          ans += (comp.size() + 1) / 2;
        else
          ans += comp.size() / 2;
        continue;
      }
      comp.erase(ma);
      for (int i : g[ma]) menos(i);
      int at = 1 + solve(comp);
      for (int i : g[ma]) {
        auto it = comp.find(i);
        if (it == comp.end()) continue;
        for (int j : g[i]) menos(j);
        comp.erase(it);
      }
      ans += min(at, deg + solve(comp));
    }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      if (!x and (i != j)) {
        g[i].push_back(j);
        m[i]++;
      }
    }
  }
  int ans = n - solve(m);
  cout << fixed << setprecision(12) << (1 - (1 / (double)ans)) * k * k / 2
       << '\n';
  exit(0);
}
