cat_num, enemy_num = gets.split.map(&:to_i)
win_prob = (1..cat_num).map {gets.split.map(&:to_f)}

one_pos = []
(0..(1<<cat_num)-1).each do |x|
    one_pos[x] = (0..cat_num-1).select {|i| x[i] == 1}
end

table = [[1] * cat_num * 2 ** cat_num]
(1..enemy_num).each do |k|
    table.unshift([0] * cat_num * 2 ** cat_num)
    retry_best = [0] * 2 ** cat_num
    (1..(1<<cat_num)-1).each do |x|
        one_pos[x].each do |c|
            pr = win_prob[c][-k]
            y = (c << cat_num) + x
            table[0][y] = pr * table[1][y] + (1 - pr) * retry_best[x - (1 << c)]
            retry_best[x] = table[0][y] if table[0][y] > retry_best[x]
        end
    end
    table.pop
end
printf("%.10f\n", table[0].max)