#include <bits/stdc++.h>

using namespace std;

typedef double ld;

//ld dp[17][1 << 16] = {0}; // dp[next enemy][used cat]

int N, M;
ld P[16][16];

bool m1[16][1 << 16] = {0};
ld m2[16][1 << 16];

ld dp(int n, int rest) {
	if (n >= N) return (ld)1;

	if (m1[n][rest]) return m2[n][rest];

	ld ret = 0;
	for (int i = 0; i < M; ++i) {
		ld p = 0;
		if (rest & (1 << i)) {
			int nr = rest & ~(1 << i);

			ld per = 1;
			for (int j = n; j < N; ++j) {
				p += per * (1 - P[i][j]) * dp(j, nr);
				per *= P[i][j];
			}
			p += per;
		}
		ret = max(ret, p);
	}
	return m1[n][rest] = true, m2[n][rest] = ret;
}
int main() {
	cin >> M >> N;
	for (int i = 0; i < M; ++i) {
		for (int j = 0; j < N; ++j) {
			cin >> P[i][j];
		}
	}

	printf("%.12f\n", (double)dp(0, (1 << M)-1));
	return 0;
}