until (given = gets.split.map(&:to_i)) == [0, 0]
  n, m = given
  g = n.times.map {gets.split.map(&:to_f)}
  memo = Array.new(101) {[]}
  
  compost = ->(num, left) {
    memo[num][left] if memo[num][left]
    memo[num][left] = if left.zero?
      1.0
    else
      n.times.map {|j| g[num][j] * compost.(j, left - 1)}.max
    end
  }
  printf "%.02f\n", n.times.map {|i| compost.(i, m - 1)}.max.round(2)
end
