#include <bits/stdc++.h>
#define FOR(i,k,n) for(int i=(k);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)
using namespace std;

double dp[1<<16][17];

int main() {
  int m, n;
  cin >> m >> n;
  vector<vector<double>> cats(m, vector<double>(n));
  REP(i,m)REP(j,n) {
    cin>>cats[i][j];
  }
  dp[0][n] = 1.0;
  REP(i,1<<m)FOR(j,0,n+1) {
    REP(k,m) {
      if ((i>>k)&1) continue;
      double live = 1.0;
      double sum = 0.0;
      FOR(l,j,n+1) {
        double oldlive = live;
        live *= cats[k][l];
        sum += dp[i][l] * (oldlive - live);
      }
      dp[i|(1<<k)][j] = max(dp[i|(1<<k)][j], sum);
    }
  }
  double res = 0.0;
  REP(i,1<<m) {
    res = max(res, dp[i][0]);
  }
  cout << fixed << setprecision(14) << res << endl;
  return 0;
}