loop do
    n, m = gets.split.map &:to_i
    break if n == 0
    a = (1..n).map { gets.split.map &:to_i }

    table = [1.0] * n
    (m-1).times do
        new_table = []
        (0..n-1).each do |i|
            new_table[i] = (0..n-1).map{|j| table[j] * a[j][i]}.max
        end
        table = new_table
    end

    puts "%.2f\n" % table.max
end