#include <iostream>
#include <cstring>	// require memset
#include <cstdio>	// require printf
//#include <fstream>	// require freopen

using namespace std;

const double max_g = 10000.0;
double t[100][100];

bool v[100];

double dfs (int n, int m, int depth, int from, double s )
{
	double res = 0.0;

	if (depth == m ){
		return s;
	} // end if

	for (int i = 0; i < n; ++i ){
		if (!v[i] ){
			v[i] = true;
			s *= t[from][i];
			res = dfs (n, m, depth + 1, i, s );
		} // end if
	} // end for

	return res;
}

		 
double search (int n, int m )
{
	int i,j;
	double res = 0.;

	for (i = 0; i < n; ++i ){
		//vector <bool> v (n, false );
		memset (v, false, sizeof(v ) );
		res = max (res, dfs (n, m, 0, i, 1. ) );
 	} // end for

	return res;
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.babytree", "r", stdin );
	int n, m;	// ì¿Ì, ì¿ð^¦éñ

	while (cin >> n >> m && n && m ){
		memset (t, 0., sizeof(t ) );
		for (int from = 0; from < n; ++from ){
			for (int to = 0; to < n; ++to ){
				cin >> t[from][to];
			} // end for
		} // end for
		double res = search (n, m );
		res += 0.005;
		int r = (res * 100.);
		res = (double)r/100.;
		printf ( "%.2f\n", res );	
	} // end loop
		
	return 0;
}