while(n,m=gets.split.map &:to_i)[0]>0
r=0..n-1
t=r.map{gets.split.map &:to_f}
d=r.map{[1]*n}
(m-1).times{d.map!{|i|r.map{|j|x=0;r.map{|k|y=i[k]*t[k][j];x<y&&x=y};x}}}
puts"%.2f"%[d.flatten.max.round(2)]
end