#include <bits/stdc++.h>

using namespace std;

int N, M;
double vv[16][16];
double dp[16][1 << 16];

double rec(int idx, int bit)
{
  if(idx == N) return (1.0);
  if(dp[idx][bit] >= 0) return (dp[idx][bit]);
  double ret = 0;
  for(int i = 0; i < M; i++) {
    if((bit >> i) & 1) continue;
    double beet = 0, fact = 1.0;
    for(int j = idx; j < N; j++) {
      beet += rec(j, bit | (1 << i)) * (1.0 - vv[i][j]) * fact;
      fact *= vv[i][j];
    }
    ret = max(ret, beet + fact);
  }
  return (dp[idx][bit] = ret);
}

int main()
{
  cin >> M >> N;
  for(int i = 0; i < M; i++) {
    for(int j = 0; j < N; j++) {
      cin >> vv[i][j];
    }
  }
  fill_n(*dp, (1 << 16) * 16, -1);
  cout << fixed << setprecision(13) << rec(0, 0) << endl;
}