#include <bits/stdc++.h>
using namespace std;
int n, m, p0;
int a[2000][30], need[2000];
struct pp {
  int x, i;
} p[2000];
double f[1100][1100], g[1100][1100], d[1100];
bool cmp(pp x, pp y) { return x.x > y.x; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &a[i][0]);
    for (int j = 1; j <= a[i][0]; ++j)
      scanf("%d", &a[i][j]), p[++p0].x = a[i][j], p[p0].i = i;
    sort(a[i] + 1, a[i] + 1 + a[i][0]);
  }
  sort(p + 1, p + 1 + p0, cmp);
  int y = 1;
  while (y <= n && p[n + 1].x != p[y].x) need[p[y].i]++, y++;
  y = n - y + 1;
  f[1][0] = f[1][1] = 1;
  for (int i = 2; i <= 20; ++i) {
    f[i][0] = f[i][i] = 1;
    for (int j = 1; j <= i - 1; ++j) f[i][j] = f[i - 1][j] + f[i - 1][j - 1];
  }
  double ans;
  int ti = 0;
  g[0][0] = 1;
  for (int i = 1; i <= m; ++i) {
    g[i][0] = g[i - 1][0] / f[a[i][0]][need[i]];
    for (int j = 1; j <= y; ++j) {
      g[i][j] = g[i - 1][j] / f[a[i][0]][need[i]];
      if (a[i][a[i][0] - need[i]] == p[n].x)
        g[i][j] += g[i - 1][j - 1] / f[a[i][0]][need[i] + 1];
    }
    if (a[i][a[i][0] - need[i]] == p[n].x) ti++;
  }
  ans = g[m][y];
  for (int i = y + 1; i <= ti; ++i) ans = (double)ans / i;
  for (int i = 2; i <= ti - y; ++i) ans = ans * i;
  printf("%.9f\n", ans);
  return 0;
}
