#include<stdio.h>
#include<string.h>
#define M(a,b)a>b?a:b
#define R(i,b)for(i=0;i<b;i++)
double C[100][100],P[100],Q[100],A;int n,m,i,j,k;int s(){R(i,n)P[i]=1;R(k,m-1){R(i,n){Q[i]=0;R(j,n)Q[i]=M(Q[i],P[j]*C[j][i]);}memcpy(P,Q,n*8);}A=0;R(i,n)A=M(A,P[i]);}main(){while(scanf("%d%d",&n,&m)&&n&&m){R(i,n)R(j,n)scanf("%lf",&C[i][j]);s();printf("%.2lf\n",A);}}