#include <iostream>
#include <algorithm>

using namespace std;

struct Data {
	int idx;
	double point;
};

int n, m;
//double map[100][100], Max;
Data data[100];
double Max;

void search( int prev, double point, int count )
{
	if(count == m) {
		if(Max < point) {
			Max = point;
		}
		return;
	}
	search(data[prev].idx, point*data[prev].point, count + 1);
}

int main( void )
{
	while(cin >> n >> m, n | m) {
		Max = 0;
		for(int i=0; i < 100; ++i) data[i].point = 0;
		for(int i=0; i < n; ++i)
			for(int j=0; j < n; ++j) {
				double point;
				cin >> point;
				if(point > data[i].point) {
					data[i].idx = i;
					data[i].point = point;
				}
			}
		for(int i=0; i < n; ++i)
			search(i, 1.0, 1);
		printf("%.2f\n", Max);
	}
	return 0;
}