#include <bits/stdc++.h>
using namespace std;
int n, m, tot, K[(1010)], a[(1010)][(1010)], b[(1010)];
double c[(1010)][(1010)], f[(1010)][(1010)], g[(1010)][(1010)];
inline int read() {
  int w = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    w = (w << 3) + (w << 1) + (ch ^ 48);
    ch = getchar();
  }
  return w;
}
inline bool cmp(int a, int b) { return a > b; }
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    K[i] = read();
    for (int j = 1; j <= K[i]; j++) a[i][j] = read(), b[++tot] = a[i][j];
  }
  c[0][0] = f[0][0] = g[0][0] = 1.0;
  for (int i = 1; i <= (1000); i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i; j++) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  sort(b + 1, b + 1 + tot, cmp);
  for (int i = 1; i <= m; i++) {
    int x = 0, y = 0;
    for (int j = 1; j <= K[i]; j++)
      x += (a[i][j] > b[n]), y += (a[i][j] == b[n]);
    for (int j = 0; j <= n; j++)
      for (int k = 0; k <= y; k++)
        if (j + k + x <= n)
          g[i][j + k + x] += g[i - 1][j],
              f[i][j + k + x] += f[i - 1][j] / c[K[i]][x + k];
  }
  printf("%.12lf\n", (f[m][n] / g[m][n]));
  return 0;
}
