#include <stdio.h>
#include <algorithm>

using namespace std;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

double p[17][17];
double dp[17][1<<16];
int n,m;

double DFS(int idx, int state){
	if(idx == n)return 1.0;
	if(dp[idx][state] >= -0.1)return dp[idx][state];
	double ret = -0.1;
	REP(i,m){
		int mask = (1<<i);
		if(mask & state)continue;
		double ret1=0.0;
		double tmp =1.0;
		FOR(j, idx, n){
			ret1 += tmp*(1-p[i][j])*DFS(j, (state|mask));
			tmp *= p[i][j];
		}
		ret1+=tmp;
		ret = max(ret, ret1);
	}
	return dp[idx][state] = max(ret, 0.0);
}

int main(){
	scanf("%d%d", &m, &n);
	REP(i,m)REP(j,n)scanf("%lf", &p[i][j]);
	REP(i,n)REP(j,(1<<m))dp[i][j]=-1.0;
	printf("%.10f\n", DFS(0,0));
	return 0;
}