#include <bits/stdc++.h>
using namespace std;
int n, m, t, x, y;
int q[10010];
int a[1010][20], b[1010], g[1010][2], c[21][21];
double f[1010][1010];
void Init() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &b[i]);
    for (int j = 1; j <= b[i]; ++j) {
      scanf("%d", &a[i][j]);
      q[++t] = a[i][j];
    }
  }
}
inline bool cmp(int A, int B) { return A > B; }
void Work() {
  c[0][0] = 1;
  for (int i = 1; i <= 20; ++i) {
    c[i][0] = 1;
    for (int j = 1; j <= i; ++j) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
  for (int i = 1; i <= m; ++i) sort(a[i] + 1, a[i] + b[i] + 1, cmp);
  sort(q + 1, q + t + 1, cmp);
  for (int i = 1; i <= m; ++i)
    if (a[i][1] >= q[n]) {
      g[i][0] = 1;
      while (g[i][0] + 1 <= b[i] && a[i][g[i][0] + 1] >= q[n]) ++g[i][0];
      if (a[i][g[i][0]] == q[n]) --g[i][0], g[i][1] = 1;
    }
  for (int i = 1; i <= m; ++i) x += g[i][1];
  for (int i = 1; i <= n; ++i)
    if (q[i] == q[n]) ++y;
}
void Solve() {
  f[0][0] = 1;
  for (int i = 0; i <= m - 1; ++i)
    if (g[i + 1][1]) {
      for (int j = 0; j <= y; ++j)
        f[i + 1][j] += f[i][j] / c[b[i + 1]][g[i + 1][0]];
      for (int j = 0; j <= y - 1; ++j)
        f[i + 1][j + 1] += f[i][j] / c[b[i + 1]][g[i + 1][0] + 1];
    } else {
      for (int j = 0; j <= y; ++j)
        f[i + 1][j] += f[i][j] / c[b[i + 1]][g[i + 1][0]];
    }
  for (int i = y + 1; i <= x; ++i) f[m][y] = f[m][y] * (i - y) / i;
  printf("%.10lf\n", f[m][y]);
}
int main() {
  Init();
  Work();
  Solve();
  return 0;
}
