#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

double memo[101][101];
double data[101][101];
int n;

void initData(){
  for(int i=0;i<101;i++)
    for(int j=0;j<101;j++)
      data[i][j] = 1;
}

void inputData(){
  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin >> data[i][j];
}

double solve(int m, int p){ //回数,直前の肥料
  
  if(!m) return 1;
  if(memo[m][p]) return memo[m][p];

  double ans = 0;
  for(int i=n;i>0;i--) ans = max(ans, solve(m-1, i)*data[p][i]);
  
  return memo[m][p] = ans;
}

int main(){
  
  int  m;
  
  while(true){
    cin >> n >> m;
    if(!n && !m) break;
    
    memset(memo, 0, sizeof(memo));
    initData();
    inputData();

    printf("%.2f\n", solve(m, 0));
  }
}