#include <bits/stdc++.h>
using namespace std;
int n, k, i, j, ans, cnt[42], vis[42], a[42][42];
bool dfs(int u, int t) {
  for (int i = u + 1; i < n; i++) {
    if (cnt[i] + t <= ans) return 0;
    if (a[u][i]) {
      int j = 0;
      for (; j < t; j++)
        if (!a[i][vis[j]]) break;
      if (j == t) {
        vis[t] = i;
        if (dfs(i, t + 1)) return 1;
      }
    }
  }
  if (t > ans) return ans = t, 1;
  return 0;
}
int main() {
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) scanf("%d", &a[i][j]);
  for (i = n - 1, ans = 1; ~i; i--) vis[0] = i, dfs(i, 1), cnt[i] = ans;
  printf("%.8lf", 0.5 * k * k * (ans - 1) / ans);
}
