#include<iostream>
#include<cmath>
#include<vector>

using namespace std;

const double eps = 1.0e-10;
double eq(double a, double b){ //a==b
  return abs(b-a)<eps;
}
double gt(double a, double b){ //a>b
  return !eq(a,b) && a > b;
}

int main(){
  while(true){
    int n,m;
    double answer = -1;
    cin >> n >> m;
    if( n == 0 && m == 0 ) break;
    double table[n][n];
    for(int i = 0; i < n; ++i){
      for(int j = 0; j < n; ++j){
	cin >> table[i][j];
      }
    }
    vector<int> colors;
    vector<double> greedy;
    for(int i = 0; i < n; ++i){
      colors.push_back( i );
      greedy.push_back( 1.0 );
    }

    for(int k = 0; k < m-1; ++k){
      vector<int> next_colors;
      vector<double> next_greedy;
      for(int i = 0; i < colors.size(); ++i){
	double maximum = -1;
	for(int j = 0; j < n; ++j){
	  double t = greedy[i] * table[ colors[i] ][ j ];
	  if( gt( t, maximum ) ){
	    maximum = t;
	  }
	}
	for(int j = 0; j < n; ++j){
	  double t = greedy[i] * table[ colors[i] ][ j ];
	  if( eq( t, maximum ) ){
	    next_colors.push_back( j );
	    next_greedy.push_back( t );
	  }
	}
      }
      colors.clear();
      greedy.clear();
      for(int i = 0; i < next_colors.size(); ++i){
	colors.push_back( next_colors[i] );
	greedy.push_back( next_greedy[i] );
      }
    }
    
    for(int i = 0; i < greedy.size(); ++i){
      if( gt( greedy[i], answer ) )
	answer = greedy[i];
    }
    printf("%.2lf\n",answer);

  }
  return 0;
}