#include <bits/stdc++.h>
using namespace std;
const int N = 45;
int mp[N][N];
int a[N], ans, n, cnt[N], K;
bool dfs(int x, int d) {
  a[d] = x;
  if (d > ans) {
    ans = d;
    return 1;
  }
  for (register int y = (x + 1); y <= (n); ++y) {
    if (!mp[x][y] || cnt[y] + d <= ans) continue;
    bool flag = 0;
    for (register int i = (1); i <= (d - 1); ++i)
      if (!mp[a[i]][y]) {
        flag = 1;
        break;
      }
    if (!flag && dfs(y, d + 1)) return 1;
  }
  return 0;
}
int solve() {
  for (register int i = (n); i >= (1); --i) dfs(i, 1), cnt[i] = ans;
  return ans;
}
double P(double x) { return x * x; }
signed main() {
  cin >> n >> K;
  for (register int i = (1); i <= (n); ++i)
    for (register int j = (1); j <= (n); ++j) cin >> mp[i][j];
  int t = solve();
  if (t <= 1) {
    cout << 0 << '\n';
    return 0;
  }
  double ans = P(K / (1.0 * t)) * (t * (t - 1) / 2);
  cout << fixed << setprecision(10) << ans << '\n';
  return 0;
}
