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)
    (1..(1<<cat_num)-1).each do |x|
        one_pos[x].each do |c|
            pr = win_prob[c][-k]
            y = (c << cat_num) + x
            z = x - (1 << c)
            one_pos[z].each do |d|
                t = table[0][(d << cat_num) + z]
                table[0][y] = t if t > table[0][y]
            end
            table[0][y] *= 1 - pr
            table[0][y] += pr * table[1][y]
        end
    end
    table.pop
end
p table[0].max