#include <bits/stdc++.h>
using namespace std;
const int N = 1015;
int n, m, k[N], cnt[N], flag[N], tot;
struct node {
  int val, sy;
} f[N];
bool cmp(node aa, node bb) { return aa.val > bb.val; }
double C[N][N], dp[N][N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (0), iE = (1000); i <= iE; i++) C[i][0] = 1;
  for (int i = (1), iE = (1000); i <= iE; i++)
    for (int j = (1), jE = (i); j <= jE; j++)
      C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
  for (int i = (1), iE = (m); i <= iE; i++) {
    scanf("%d", &k[i]);
    for (int j = (1), jE = (k[i]); j <= jE; j++) {
      int t;
      scanf("%d", &t), ++tot, f[tot].val = t, f[tot].sy = i;
    }
  }
  sort(f + 1, f + tot + 1, cmp);
  int col = f[n].val, ned = 0, sum = 0;
  for (int i = (1), iE = (n); i <= iE; i++) {
    if (f[i].val == col)
      ned++;
    else
      cnt[f[i].sy]++;
  }
  for (int i = (1), iE = (tot); i <= iE; i++)
    if (f[i].val == col) flag[f[i].sy] = 1, ++sum;
  dp[0][0] = 1;
  for (int i = (1), iE = (m); i <= iE; i++) {
    for (int j = (0), jE = (ned); j <= jE; j++)
      dp[i][j] += dp[i - 1][j] / C[k[i]][cnt[i]];
    if (flag[i])
      for (int j = (1), jE = (ned); j <= jE; j++)
        dp[i][j] += dp[i - 1][j - 1] / C[k[i]][cnt[i] + 1];
  }
  printf("%.12lf\n", dp[m][ned] / C[sum][ned]);
  return 0;
}
