#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int POW[17],M,N;
double dp[65536][16];
double table[16][16];

double dfs(int state,int enemy){

	if(enemy == N)return 1.0;
	if(state == 0)return 0.0;

	if(dp[state][enemy] >= 0.0)return dp[state][enemy];

	double maximum = 0.0;

	for(int cat = 0; cat < M; cat++){
		if(!(state & (1 << cat)))continue;

		double sum = 0.0,prob = 1.0;
		int next_state = state - POW[cat];

		for(int i = enemy; i < N; i++){
			sum += dfs(next_state,i)*prob*(1.0-table[cat][i]);
			prob *= table[cat][i];
		}
		sum += prob;

		maximum = max(maximum,sum);
	}

	return dp[state][enemy] = maximum;
}

int main(){

	for(int i = 0; i <= 16; i++)POW[i] = pow(2,i);

	scanf("%d %d",&M,&N);

	for(int i = 0; i < M; i++){
		for(int k = 0; k < N; k++)scanf("%lf",&table[i][k]);
	}

	int limit = POW[M];

	for(int i = 0; i < limit; i++){
		for(int k = 0; k < N; k++){
			dp[i][k] = -1.0;
		}
	}

	printf("%.12lf\n",dfs(limit-1,0));

	return 0;
}