#include<iostream>
#include<cstdio>
using namespace std;
int n,m,i,j,before,max_no[101]={};
double ans,dp,g[101][101]={};
double max_c[101]={};
double solve(){
  ans=0;
  for(i=0;i<n;i++){
    dp=1.0;
    before=i;
    for(j=0;j<m-1;j++){
      dp *= max_c[before];
      before=max_no[101];
    }
    if(ans<dp) ans=dp;
  }
  return ans;
}
//  for(j=0;j<n;j++){

int main(){
  while(cin>>n>>m, n||m){
    for(i=0;i<n;i++){
      max_c[i]=0;
      for(j=0;j<n;j++){
	cin>>g[i][j];
	if(max_c[i]<g[i][j]){
	  max_c[i]=g[i][j];
	  max_no[i]=j;
	}
      }
    }
    printf("%.2f\n",solve());
  }
  return 0;
}
  