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

typedef vector <double> VD;
typedef vector <VD> VVD;

VVD C;
int n; // ì¿ÌíÞ
int m; // ì¿ð^¦éñ
double answer;
double tmp;

/* æÃ~ÉT[` */
void greedy_search( int prev, int depth )
{
	if ( depth >= m ) return;

	int max_no = -1;
	double max_value = -1.0;
	for ( int i = 0; i < n; i++ )
	{
		if ( max_value < C[prev][i] )
		{
			max_no = i;
			max_value = C[prev][i];
		}
	}

	tmp *= C[prev][max_no];
	greedy_search( max_no, depth + 1 );
}

int main( void )
{
	while ( cin >> n >> m && n > 0 && m > 0 )
	{
		C = VVD( n, VD( n, 0.0 ) );

		// üÍ
		for ( int i = 0; i < n; i++ )
		{
			for ( int j = 0; j < n; j++ )
			{
				cin >> C[i][j];
			}
		}

		// Tõ
		answer = -1.0;
		for ( int i = 0; i < n; i++ )
		{
			tmp = 1.0;
			greedy_search( i, 1 );
			answer = max( answer, tmp );
		}
		cout.setf( ios::fixed );
		cout.precision( 2 );
		cout << answer << endl;
	}

	return 0;
}