#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int M, N;
double dp[17][17][1 << 16];
double p[17][17];

template <typename T>
bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> M >> N;
    for(int i = 0; i < M; i++) {
        for(int j = 0; j < N; j++) {
            cin >> p[i][j];
        }
    }
    for(int i = 1; i < (1 << M); i++) {
        for(int j = 0; j < M; j++) {
            if((1 << j) & i) {
                //cerr << N << " " << j << " " << i << " " << 1 << endl;
                dp[N][j][i] = 1;
            }
        }
    }
    for(int i = N - 1; i >= 0; i--) {
        for(int j = 0; j < (1 << M); j++) {
            for(int k = 0; k < M; k++) {
                if(!(j & (1 << k))) continue;
                double now = p[k][i] * dp[i+1][k][j];
                double losemax = 0;
                int subbits = (j & (~(1 << k)));
                //cerr << subbits << endl;
                for(int l = 0; l < M; l++) {
                    if(!(subbits & (1 << l))) continue;
                    chmax(losemax, dp[i][l][subbits]);
                }
                now += (1 - p[k][i]) * losemax;
                chmax(dp[i][k][j], now);
                //cerr << i << " " << k << " " << j << " " << now << " " << losemax << endl;
            }
        }
    }
    double ans = 0;
    for(int i = 0; i < M; i++) {
        chmax(ans, dp[0][i][(1 << M) - 1]);
    }
    cout << fixed << setprecision(30) << ans << endl;
    return 0;
}
