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

table = [[1] * cat_num * 2 ** cat_num]
(1..enemy_num).each do |k|
    table.unshift([0] * cat_num * 2 ** cat_num)
    (1..(1<<cat_num)-1).each do |x|
        (0..cat_num-1).each do |c|
            next if x[c] == 0
            y = (c << cat_num) + x
            pr = win_prob[c][-k]
            table[0][y] = pr * table[1][y]
            z = x - (1 << c)
            table[0][y] += (0..cat_num-1).map {|d|
                z[d] == 0 ? 0 : table[0][(d << cat_num) + z]
            }.max * (1 - pr)
        end
    end
    table.pop
end
p table[0].max