#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
double C[maxn][maxn], opt[maxn][maxn];
long double F[maxn];
static int L[maxn], n, m, ls;
static int now[maxn];
static bool vis[maxn];
struct T {
  int x, y;
  friend bool operator<(const T &a, const T &b) {
    return a.x > b.x || a.x == b.x && a.y < b.y;
  }
} S[maxn];
int main() {
  scanf("%d%d", &m, &n);
  F[0] = 1;
  for (int i = 1; i <= 1000; i++) F[i] = F[i - 1] * i;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &L[i]);
    for (int j = 1; j <= L[i]; j++) {
      ls++;
      scanf("%d", &S[ls].x);
      S[ls].y = i;
    }
  }
  sort(S + 1, S + ls + 1);
  int ed = 0, st;
  while (ed < m) {
    st = ed + 1;
    while (S[st].x == S[ed + 1].x) ed++;
  }
  for (int i = 1; i < st; i++) now[S[i].y]++;
  for (int i = st; i <= ed; i++) vis[S[i].y] = true;
  m -= st - 1;
  double tmp = 1;
  for (int i = 1; i <= n; i++)
    if (vis[i] == false) tmp /= F[L[i]] / F[now[i]] / F[L[i] - now[i]];
  opt[0][0] = 1;
  st--;
  for (int i = 1; i <= ed - st; i++) {
    int x = S[i + st].y;
    opt[i][0] = opt[i - 1][0] / (F[L[x]] / F[now[x]] / F[L[x] - now[x]]);
    for (int j = 1; j < i && j <= m; j++)
      opt[i][j] = opt[i - 1][j - 1] /
                      (F[L[x]] / F[now[x] + 1] / F[L[x] - now[x] - 1]) * j / i +
                  opt[i - 1][j] / (F[L[x]] / F[now[x]] / F[L[x] - now[x]]) *
                      (i - j) / i;
    if (i <= m)
      opt[i][i] =
          opt[i - 1][i - 1] / (F[L[x]] / F[now[x] + 1] / F[L[x] - now[x] - 1]);
  }
  tmp = tmp * opt[ed - st][m];
  printf("%.9lf\n", tmp);
  return 0;
}
