#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
int a[N], d[N];
double C[N][N], dp[N][N];
vector<int> v[N];
int main() {
  int n, m, i, j, k, x, y, z, tt = 0;
  scanf("%d%d", &m, &n);
  C[0][0] = 1;
  for (i = 1; i <= 1001; i++) {
    C[i][0] = C[i][i] = 1;
    for (j = 1; j < i; j++) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
  }
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    while (k--) {
      scanf("%d", &x);
      v[i].push_back(x);
      a[++tt] = x;
    }
  }
  sort(a + 1, a + tt + 1);
  x = a[tt - m + 1];
  y = 0, z = 0;
  for (i = 1; i <= tt; i++) y += (a[i] == x), z += (a[i] > x);
  dp[0][0] = 1;
  for (i = 1; i <= n; i++) {
    int f = 0, ts = 0, yy, sz = v[i].size();
    for (j = 0; j < v[i].size(); j++) {
      yy = v[i][j];
      if (yy == x) f = 1;
      if (yy > x) ts++;
    }
    for (k = 1; k <= m - z; k++)
      dp[i][k] =
          dp[i - 1][k] / C[sz][ts] + (f ? dp[i - 1][k - 1] / C[sz][ts + 1] : 0);
    dp[i][0] = dp[i - 1][0] / C[sz][ts];
  }
  double ans = dp[n][m - z] / C[y][m - z];
  printf("%.9lf\n", ans);
}
