#include <iostream>
#include <algorithm>

using namespace std;

int n, m;
double map[100][100], Max;

void search( int prev, double point, int count )
{
	if(count == m) {
		if(Max < point) {
			Max = point;
		}
		return;
	}
	for(int i=0; i < n; ++i)
		search(i, point*map[prev][i], count + 1);
}

int main( void )
{
	while(cin >> n >> m, n | m) {
		Max = 0;
		for(int i=0; i < n; ++i)
			for(int j=0; j < m; ++j)
				cin >> map[i][j];
		for(int i=0; i < n; ++i)
			search(i, 1.0, 1);
		int tmp = Max * 1000;
		Max = tmp / 1000.0;
		printf("%.2f\n", Max);
	}
	return 0;
}