#include <bits/stdc++.h>
using namespace std;
const int N = 1023;
long double dp[N][N], a[N], b[N];
vector<int> p[N], all;
int size[N];
bool flag[N];
double C(int n, int m) {
  double re = 1;
  for (int i = 1; i <= m; i++) {
    re *= (n - m + i + 0.0) / (i + 0.0);
  }
  return re;
}
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m) == 2) {
    all.clear();
    memset(dp, 0, sizeof(dp));
    memset(flag, false, sizeof(flag));
    int dat;
    for (int i = 1; i <= m; i++) {
      scanf("%d", &size[i]);
      p[i].clear();
      for (int j = 0; j < size[i]; j++) {
        scanf("%d", &dat);
        p[i].push_back(dat);
        all.push_back(dat);
      }
      sort(p[i].begin(), p[i].end());
    }
    sort(all.rbegin(), all.rend());
    int key = all[n - 1], samekey = 0, needkey = -1;
    for (int i = 0; i < (int)all.size(); i++) {
      if (all[i] == key) {
        if (needkey == -1) needkey = n - i;
        samekey++;
      }
    }
    for (int i = 1; i <= m; i++) {
      int j;
      for (j = 0; j < size[i]; j++) {
        if (p[i][j] >= key) break;
      }
      a[i] = 1.0 / C(size[i], size[i] - j);
      if (j < size[i] && p[i][j] == key)
        b[i] = 1.0 / C(size[i], size[i] - j - 1);
      else
        flag[i] = true;
    }
    dp[0][0] = 1;
    for (int i = 1; i <= m; i++) {
      for (int j = 0; j <= needkey; j++) {
        if (flag[i]) {
          dp[i][j] += dp[i - 1][j] * a[i];
        } else {
          dp[i][j] += dp[i - 1][j] * b[i];
          if (j > 0) dp[i][j] += dp[i - 1][j - 1] * a[i];
        }
      }
    }
    double ans = dp[m][needkey] / C(samekey, needkey);
    printf("%.10lf\n", ans);
  }
  return 0;
}
