m, n = gets.split.map(&:to_i)
win_rate = (1..m).map { gets.split.map(&:to_f) }

table = Array(n+1)
table[n] = (0..2**m-1).map { 1 }

(n-1).downto(0) do |i|
    table[i] = [0]
    (1..2**m-1).each do |x|
        max = 0
        (0..m-1).each do|j|
            next if x[j] == 0
            sum = 0
            prob = 1
            (i..n).each do |k|
                sum += prob * (1 - (k == n ? 0 : win_rate[j][k])) * table[k][x - (1 << j)]
                prob *= win_rate[j][k] if k < n
            end
            max = sum if sum > max
        end
        table[i][x] = max
    end
end

printf("%.12f\n", table[0][2**m-1])