#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
using namespace std;
#define rep(i, j) for(int i = 0; i < j; i++)
#define f(i, k, j) for(int i = k; i < j; i++)
#define P pair<int, int>
const int INF = (1 << 26);

int n, m;
vector< vector<double> > vec, dp;

void solve(){
    f(j, 2, m + 1){
        vector<P> m;
        double bef = 0.0;
        rep(i, n){
            if(bef <= dp[i][j - 1]){
                m.push_back( P(dp[i][j - 1], i) );
                bef = dp[i][j - 1];
            }
        }
        rep(i, n){
            rep(k, m.size()){
                dp[i][j] = max(dp[i][j], m[k].first * vec[m[k].second][i]);
            }
        }
    }
}

double disp(double ans){
    ans = (int)(ans * 100 + 0.5);
    return ans / 100;
}

int main(){
    while(cin >>n >>m && n != 0 && m != 0){
        vec = vector< vector<double> >(n);
        rep(i, n){
            vec[i] = vector<double>(n);
            rep(j, n) cin >>vec[i][j];
        }
        dp = vector< vector<double> >(n);
        rep(i, n){
            dp[i] = vector<double>(m + 1, 0);
            dp[i][0] = 1.0;
            dp[i][1] = 1.0;
        }

        solve();
        double ans = 0.0;
        rep(i, n) if(ans < dp[i][m]) ans = dp[i][m];
        printf("%.2lf\n", disp(ans));
    }
    return 0;
}