#include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>

using namespace std;

vector< vector<double> > hyou(100, vector<double>(100, 0.0));

double seityo(int prev, int type, int limit, double nae) {
	if (limit == 0) {
		return nae;
	} else {
		double MAX = 0.0;
		for (int i = 0; i < type; i++) {
			if (prev != -1) {
				MAX = max(MAX, seityo(i, type, limit-1, nae*hyou[prev][i]));
			} else {
				MAX = max(MAX, seityo(i, type, limit-1, nae));
			}
		}
		return MAX;
	}
}

int main() {
	int n, m;
	while (cin >> n >> m) {
		if (n == 0 && m == 0) {
			break;
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				cin >> hyou[i][j];
			}
		}
		double d = seityo(-1, n, m, 1.0);
		int dd = d * 1000;
		if (dd % 10 >= 5) {
			dd += 10;
		}
		d = dd / 1000.0;
		printf("%.2f\n", d);
	}
	return 0; 
}