#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
  while(1){
    int n,m; cin >> n >> m;
    if( n == 0 && m == 0 ) break;
    
    int i,j;
    double data[101][101];
    for( i = 1; i <= n; i++ ){
      for( j = 1; j <= n; j++ ){
	cin >> data[i][j];
      }
    }
    
    int tmp;
    double total,total_max = -1.0;
    for( i = 1; i <= n; i++ ){
      tmp = i;
      total = 1.0;
      while( m > 1 ){
	m--;
	double max = -1.0;
	  for( j = 1; j <= n; j++ ){
	    if( max < data[tmp][j] ){
	      max = data[tmp][j];
	      tmp = j;
	    }
	  }
	total *= max;
      }
      if( total_max < total ) total_max = total;
    }
    printf("%.2f\n",total_max);
  }
  return 0;
}
  