Problem: There are n castles in the Lannister's Kingdom and some walls connect two castles, no two castles are connected by more than one wall, no wall connects a castle to itself. 

Sir Jaime Lannister has discovered that Daenerys Targaryen is going to attack his kingdom soon. Therefore he wants to defend his kingdom. He has k liters of a strange liquid. He wants to distribute that liquid among the castles, so each castle may contain some liquid (possibly zero or non-integer number of liters). After that the stability of a wall is defined as follows: if the wall connects two castles a and b, and they contain x and y liters of that liquid, respectively, then the strength of that wall is x·y.

Your task is to print the maximum possible sum of stabilities of the walls that Sir Jaime Lannister can achieve.

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 40, 1 ≤ k ≤ 1000).

Then n lines follows. The i-th of these lines contains n integers ai, 1, ai, 2, ..., ai, n (<image>). If castles i and j are connected by a wall, then ai, j = 1. Otherwise it is equal to 0.

It is guaranteed that ai, j = aj, i and ai, i = 0 for all 1 ≤ i, j ≤ n.

Output

Print the maximum possible sum of stabilities of the walls that Sir Jaime Lannister can achieve.

Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6.

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if <image>.

Examples

Input

3 1
0 1 0
1 0 0
0 0 0


Output

0.250000000000


Input

4 4
0 1 0 1
1 0 1 0
0 1 0 1
1 0 1 0


Output

4.000000000000

Note

In the first sample, we can assign 0.5, 0.5, 0 liters of liquid to castles 1, 2, 3, respectively, to get the maximum sum (0.25).

In the second sample, we can assign 1.0, 1.0, 1.0, 1.0 liters of liquid to castles 1, 2, 3, 4, respectively, to get the maximum sum (4.0)

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n, a[50][50], ACC;
double k, ans, cap[50];
bool removable(vector<int> neighbor, vector<int> cover);
int max_removable(vector<vector<int> > neighbors, vector<int> cover);
vector<int> procedure_1(vector<vector<int> > neighbors, vector<int> cover);
vector<int> procedure_2(vector<vector<int> > neighbors, vector<int> cover,
                        int k);
int cover_size(vector<int> cover);
int ppp() {
  int n, i, j, k, K, p, q, r, s, min, edge, counter = 0;
  n = ::n;
  vector<vector<int> > graph;
  for (i = 0; i < n; i++) {
    vector<int> row;
    for (j = 0; j < n; j++) {
      scanf("%d", &edge);
      if (edge == 0)
        row.push_back(1);
      else
        row.push_back(0);
    }
    graph.push_back(row);
  }
  vector<vector<int> > neighbors;
  for (i = 0; i < graph.size(); i++) {
    vector<int> neighbor;
    for (j = 0; j < graph[i].size(); j++)
      if (graph[i][j] == 1) neighbor.push_back(j);
    neighbors.push_back(neighbor);
  }
  K = n;
  k = n - K;
  bool found = false;
  min = n + 1;
  vector<vector<int> > covers;
  vector<int> allcover;
  for (i = 0; i < graph.size(); i++) allcover.push_back(1);
  for (i = 0; i < allcover.size(); i++) {
    if (found) break;
    counter++;
    vector<int> cover = allcover;
    cover[i] = 0;
    cover = procedure_1(neighbors, cover);
    s = cover_size(cover);
    if (s < min) min = s;
    if (s <= k) {
      covers.push_back(cover);
      found = true;
      break;
    }
    for (j = 0; j < n - k; j++) cover = procedure_2(neighbors, cover, j);
    s = cover_size(cover);
    if (s < min) min = s;
    covers.push_back(cover);
    if (s <= k) {
      found = true;
      break;
    }
  }
  for (p = 0; p < covers.size(); p++) {
    if (found) break;
    for (q = p + 1; q < covers.size(); q++) {
      if (found) break;
      counter++;
      vector<int> cover = allcover;
      for (r = 0; r < cover.size(); r++)
        if (covers[p][r] == 0 && covers[q][r] == 0) cover[r] = 0;
      cover = procedure_1(neighbors, cover);
      s = cover_size(cover);
      if (s < min) min = s;
      if (s <= k) {
        found = true;
        break;
      }
      for (j = 0; j < k; j++) cover = procedure_2(neighbors, cover, j);
      s = cover_size(cover);
      if (s < min) min = s;
      if (s <= k) {
        found = true;
        break;
      }
    }
  }
  return n - min;
}
bool removable(vector<int> neighbor, vector<int> cover) {
  bool check = true;
  for (int i = 0; i < neighbor.size(); i++)
    if (cover[neighbor[i]] == 0) {
      check = false;
      break;
    }
  return check;
}
int max_removable(vector<vector<int> > neighbors, vector<int> cover) {
  int r = -1, max = -1;
  for (int i = 0; i < cover.size(); i++) {
    if (cover[i] == 1 && removable(neighbors[i], cover) == true) {
      vector<int> temp_cover = cover;
      temp_cover[i] = 0;
      int sum = 0;
      for (int j = 0; j < temp_cover.size(); j++)
        if (temp_cover[j] == 1 && removable(neighbors[j], temp_cover) == true)
          sum++;
      if (sum > max) {
        max = sum;
        r = i;
      }
    }
  }
  return r;
}
vector<int> procedure_1(vector<vector<int> > neighbors, vector<int> cover) {
  vector<int> temp_cover = cover;
  int r = 0;
  while (r != -1) {
    r = max_removable(neighbors, temp_cover);
    if (r != -1) temp_cover[r] = 0;
  }
  return temp_cover;
}
vector<int> procedure_2(vector<vector<int> > neighbors, vector<int> cover,
                        int k) {
  int count = 0;
  vector<int> temp_cover = cover;
  int i = 0;
  for (int i = 0; i < temp_cover.size(); i++) {
    if (temp_cover[i] == 1) {
      int sum = 0, index;
      for (int j = 0; j < neighbors[i].size(); j++)
        if (temp_cover[neighbors[i][j]] == 0) {
          index = j;
          sum++;
        }
      if (sum == 1 && cover[neighbors[i][index]] == 0) {
        temp_cover[neighbors[i][index]] = 1;
        temp_cover[i] = 0;
        temp_cover = procedure_1(neighbors, temp_cover);
        count++;
      }
      if (count > k) break;
    }
  }
  return temp_cover;
}
int cover_size(vector<int> cover) {
  int count = 0;
  for (int i = 0; i < cover.size(); i++)
    if (cover[i] == 1) count++;
  return count;
}
int main() {
  scanf("%d%lf", &n, &k);
  int sz = ppp();
  if (sz <= 1) return 0 * printf("0\n");
  double ans = k * k / sz * (sz - 1) / 2.;
  printf("%.15lf\n", ans);
  return 0;
}