#include <iostream>
#include <iomanip>
using namespace std;

double fig[100][100];
int n,m;

double serch(int kind,double point,int count){
	if(count==m)
		return point;
	double ans = 0.0;
	int num;
	for(int i=0;i<n;i++){
			if(ans < fig[kind][i]){
				ans = fig[kind][i];
				num = i;
			}
	}
	return serch(num,point*ans,count+1);
}
int main()
{
	while(cin >> n >> m){
		if(!n && !m)
			break;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				cin >> fig[i][j];
			}
		}
		double ans = 0.0;
		for(int i=0;i<n;i++){
			ans = max(ans,serch(i,1.0,1));
		}
		cout << setprecision(2)<< fixed << ans << endl;
	}
	return 0;
}