#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
const double eps = 1e-50;
const double inf = 1e50;
double C[maxn][maxn];
void GetC(void) {
  C[0][0] = 1.0;
  for (int i = 1; i < maxn; i++) {
    C[i][0] = 1.0;
    for (int j = 1; j <= i; j++) {
      C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
      if (C[i][j] > inf) C[i][j] = inf;
    }
  }
}
int n, m;
int A[maxn][maxn], L[maxn], d[maxn];
bool haveV[maxn];
int tmp[maxn], Ltmp = 0;
double f[maxn][maxn];
int main() {
  GetC();
  scanf("%d %d", &m, &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &L[i]);
    for (int j = 0; j < L[i]; j++) {
      scanf("%d", &A[i][j]);
      tmp[Ltmp++] = A[i][j];
    }
  }
  sort(tmp, tmp + Ltmp, greater<int>());
  int V = tmp[m - 1], sumd = 0, sumV = 0;
  memset(d, 0, sizeof(d));
  memset(haveV, false, sizeof(haveV));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < L[i]; j++) {
      if (A[i][j] > V) d[i]++;
      if (A[i][j] == V) haveV[i] = true;
    }
    sumd += d[i];
    sumV += haveV[i] ? 1 : 0;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j <= n; j++) f[i][j] = 0.0;
  f[0][0] = 1.0 / C[L[0]][d[0]];
  if (haveV[0]) f[0][1] = 1.0 / C[L[0]][d[0] + 1];
  for (int i = 1; i < n; i++) {
    for (int j = 0; j <= m - sumd; j++) {
      f[i][j] = f[i - 1][j] / C[L[i]][d[i]];
      if (j > 0 && haveV[i]) f[i][j] += f[i - 1][j - 1] / C[L[i]][d[i] + 1];
    }
  }
  printf("%.10lf\n", f[n - 1][m - sumd] / C[sumV][m - sumd]);
  return 0;
}
