#include <bits/stdc++.h>
using namespace std;
inline void readInt(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
inline void readLong(long long &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const int maxn = 45;
int n, k, tot, a[maxn][maxn], tmp[maxn], rec[maxn], ans[maxn], doit = 10000;
double l[maxn], ret;
int main() {
  readInt(n);
  readInt(k);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) readInt(a[i][j]);
  for (int i = 1; i <= n; i++) tmp[i] = i;
  while (doit--) {
    random_shuffle(tmp + 1, tmp + n + 1);
    int t = 0;
    for (int i = 1; i <= n; i++) {
      rec[++t] = tmp[i];
      for (int j = 1; j < t; j++) {
        if (!a[rec[j]][rec[t]]) {
          t--;
          break;
        }
      }
    }
    if (t > tot) {
      tot = t;
      for (int i = 1; i <= t; i++) ans[i] = rec[i];
    }
  }
  for (int i = 1; i <= tot; i++) l[ans[i]] = 1.0 * k / tot;
  ret = 0;
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) ret += l[i] * l[j];
  printf("%.10f\n", ret);
  return 0;
}
