#include <bits/stdc++.h>
using namespace std;
int n, m;
int k[1111];
int v[1111][1111];
int b[1111], N;
int ev, es, es2;
long double c[1111][1111], f[1111][1111];
int cnt[1111], eq[1111];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &k[i]);
    for (int j = 1; j <= k[i]; ++j) {
      scanf("%d", &v[i][j]);
      b[++N] = v[i][j];
    }
  }
  sort(b + 1, b + 1 + N);
  ev = b[N - n + 1];
  for (int i = N - n + 1; i <= N && b[i] == ev; ++i) es++;
  N = unique(b + 1, b + 1 + N) - b - 1;
  ev = lower_bound(b + 1, b + 1 + N, ev) - b;
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= k[i]; ++j) {
      v[i][j] = lower_bound(b + 1, b + 1 + N, v[i][j]) - b;
      if (v[i][j] > ev) cnt[i]++;
      if (v[i][j] == ev) eq[i] = 1, es2++;
    }
  c[0][0] = 1.0;
  for (int i = 1; i <= 1000; ++i) {
    c[i][0] = c[i][i] = 1.0;
    for (int j = 1; j < i; ++j) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  f[0][0] = 1;
  for (int i = 1; i <= m; ++i)
    for (int j = 0; j <= es; ++j) {
      f[i][j] = f[i - 1][j] / c[k[i]][cnt[i]];
      if (eq[i] && j >= 1) f[i][j] += f[i - 1][j - 1] / c[k[i]][cnt[i] + 1];
      double t = f[i][j];
    }
  double tmp = f[m][es] / c[es2][es];
  printf("%.10f\n", tmp);
}
