#include <bits/stdc++.h>
using namespace std;
long a[1010][1010], b[1010];
double C[1010][1010], f[1010][1010], g[1010][1010];
long n, m, i, j, k, x, y, z;
bool cmp(long x, long y) { return x > y; }
int main() {
  scanf("%ld%ld", &n, &m);
  for (i = 0; i < m; i++)
    for (scanf("%ld", &k), j = 1; j <= k; j++) {
      scanf("%ld", &x);
      a[i][++a[i][0]] = b[++b[0]] = x;
    }
  for (i = 0; i <= 1000; i++)
    for (j = 0; j <= i; j++)
      if (i && j)
        C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
      else
        C[i][j] = 1;
  sort(b + 1, b + b[0] + 1, cmp);
  f[0][0] = g[0][0] = 1;
  for (i = 0; i < m; i++) {
    for (x = y = 0, j = 1; j <= a[i][0]; j++) {
      x += (a[i][j] > b[n]);
      y += (a[i][j] == b[n]);
    }
    for (j = 0; j <= n; j++)
      for (k = 0; k <= y; k++)
        if (j + x + k <= n) {
          g[i + 1][j + x + k] += g[i][j];
          f[i + 1][j + x + k] += f[i][j] / C[a[i][0]][x + k];
        }
  }
  printf("%0.12f\n", f[m][n] / g[m][n]);
  return 0;
}
