#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
double c[1007][1007];
int n, m;
vector<vector<int> > w;
double dp[1007][1007];
int main() {
  for (int i = 0; i <= 1000; ++i) {
    c[i][0] = c[i][i] = 1;
    for (int j = 1; j < i; ++j) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
  cin >> n >> m;
  vector<int> goods, must;
  w.resize(m);
  for (int i = 0; i < m; i++) {
    int k;
    cin >> k;
    w[i].resize(k);
    for (int j = 0; j < k; j++) {
      cin >> w[i][j];
      goods.push_back(w[i][j]);
    }
  }
  sort(goods.begin(), goods.end());
  reverse(goods.begin(), goods.end());
  int aim = goods[n - 1];
  must.resize(m);
  fill(must.begin(), must.end(), 0);
  vector<bool> can;
  can.resize(m);
  fill(can.begin(), can.end(), 0);
  int count = 0;
  for (int i = 0; i < m; i++)
    for (typeof(w[i].begin()) it = w[i].begin(); it != w[i].end(); it++) {
      if (*it > aim) {
        ++must[i];
        --n;
      }
      if (*it == aim) {
        can[i] = true;
        ++count;
      }
    }
  dp[0][0] = 1;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < count + 1; j++) {
      if (dp[i][j] < 1e-15) continue;
      dp[i + 1][j] += dp[i][j] / c[w[i].size()][must[i]];
      if (can[i]) {
        dp[i + 1][j + 1] += dp[i][j] / c[w[i].size()][must[i] + 1];
      }
    }
  double ans = dp[m][n] / c[count][n];
  printf("%.10f\n", ans);
  return 0;
}
