#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n, m, c[100], max, p;
	double a[100][100], b[100];
	
	while(1){
		cin >> n >> m;
		if(n == 0 && m == 0){
			break;
		}
	
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				cin >> a[i][j];
			}
			c[i] = i;
		}
		fill(b, b+n, 1.0);
	
		for(int k = 1; k < m; k++){
			for(int i = 0; i < n; i++){
				max = 0.0;
				for(int j = 0; j < n; j++){
					if(max < a[c[i]][j]){
						max = a[c[i]][j];
						p = j;
					}
				}
				b[i] *= max;
				c[i] = p;
			}
		}
		sort(b, b+n);
		
		printf("%.2f\n", b[n-1]);
	}
	
	return 0;
}