#include <iostream>
#include <cstdio>

const double inf = 1000;

int n, m;
double g[101][101];
double dp[101][101]; //iテ・ツ崢榲ァツ崢ョテ」ツ?ォテ・ツ可催・ツ崢枳テ」ツつ津、ツクツ偲」ツ?暗」ツ?淌ヲツ卍づ」ツ?ョテヲツ慊?・ツ、ツァテ・ツ?、

int main(){
	while(true){
		for(int i = 0; i < 101; ++i){
			for(int j = 0; j < 101; ++j)dp[i][j] = -1;
		}
		
		std::cin >> n >> m;
		if(n == 0 && m == 0)break;
		
		
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				std::cin >> g[i][j];
			}
		}
		
		for(int i = 0; i < n; ++i)dp[0][i] = 1.0;
		
		for(int i = 0; i < m - 1; ++i){
			for(int j = 0; j < n; ++j){
				if(dp[i][j] == -1)continue;
				
				double maxV = -inf;
				int maxI;
				for(int k = 0; k < n; ++k){
					if(maxV < g[j][k])maxV = g[j][k], maxI = k;
				}
				
				dp[i + 1][maxI] = maxV * dp[i][j];
			}
		}
		
		
		double ans = 0;
		for(int i = 0; i < n; ++i){
			if(dp[m - 1][i] > ans)ans = dp[m - 1][i];
		}
		
		printf("%.2f\n", ans);
	}
	
	return 0;
}