#include <bits/stdc++.h>
using namespace std;
const int z = 1005;
int l[z], res[z], p[z][z];
double c[z][z], ans[z][z];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, m, tot, i, j, t, cnt, ct;
  scanf("%d%d", &n, &m);
  tot = 0;
  for (i = 0; i < m; i++) {
    scanf("%d", l + i);
    for (j = 0; j < l[i]; j++) res[tot++] = (scanf("%d", &p[i][j]), p[i][j]);
    sort(&p[i][0], &p[i][l[i]], cmp);
  }
  sort(res, res + tot, cmp);
  for (i = n - 1; i >= 0 && res[i] == res[n - 1]; i--)
    ;
  cnt = n - 1 - i;
  for (i = 0; i <= 1000; i++)
    for (c[i][0] = 1, j = 1; j <= i; j++)
      c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  memset(ans, 0, sizeof ans);
  ans[0][0] = 1, ct = 0;
  for (i = 0; i < m; i++) {
    for (t = 0; t < l[i] && p[i][t] >= res[n - 1]; t++)
      ;
    if (t && p[i][t - 1] == res[n - 1]) {
      ans[i + 1][0] = ans[i][0] / c[l[i]][t - 1];
      for (j = 1; j <= cnt; j++)
        ans[i + 1][j] = ans[i][j] / c[l[i]][t - 1] + ans[i][j - 1] / c[l[i]][t];
      ct++;
    } else {
      for (j = 0; j <= cnt; j++) ans[i + 1][j] = ans[i][j] / c[l[i]][t];
    }
  }
  printf("%.12lf\n", ans[m][cnt] / c[ct][cnt]);
  return 0;
}
